/*
 * Copyright (c) 2021-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!

// NOLINTBEGIN(readability-identifier-naming)
template <Format FORMAT, typename It, typename... Types>
static size_t Emit(It out, Types... args) { // NOLINT(readability-function-size)
    size_t insn_len = 0;

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::ID16) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::ID32) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM16) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM32) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM64) {
        constexpr size_t SIZE = 9;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 72};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM8) {
        constexpr size_t SIZE = 2;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 16};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::NONE) {
        constexpr size_t SIZE = 1;
        constexpr std::array<uint8_t, 2> OFF{0, 8};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_IMM32) {
        constexpr size_t SIZE = 6;
        constexpr std::array<uint8_t, 3> OFF{0, 16, 48};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_NONE) {
        constexpr size_t SIZE = 2;
        constexpr std::array<uint8_t, 2> OFF{0, 16};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V4_V4) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 4> OFF{0, 16, 20, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V4_V4_ID16) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 5> OFF{0, 16, 20, 24, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V4_V4_ID32) {
        constexpr size_t SIZE = 7;
        constexpr std::array<uint8_t, 5> OFF{0, 16, 20, 24, 56};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V4_V4_IMM32) {
        constexpr size_t SIZE = 7;
        constexpr std::array<uint8_t, 5> OFF{0, 16, 20, 24, 56};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V4_V4_V4_V4_ID16) {
        constexpr size_t SIZE = 6;
        constexpr std::array<uint8_t, 7> OFF{0, 16, 20, 24, 28, 32, 48};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 3> OFF{0, 16, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_ID16) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 4> OFF{0, 16, 24, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_ID32) {
        constexpr size_t SIZE = 7;
        constexpr std::array<uint8_t, 4> OFF{0, 16, 24, 56};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_IMM32) {
        constexpr size_t SIZE = 7;
        constexpr std::array<uint8_t, 4> OFF{0, 16, 24, 56};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_V8) {
        constexpr size_t SIZE = 4;
        constexpr std::array<uint8_t, 4> OFF{0, 16, 24, 32};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_V8_ID32) {
        constexpr size_t SIZE = 8;
        constexpr std::array<uint8_t, 5> OFF{0, 16, 24, 32, 64};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_V8_IMM8) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 5> OFF{0, 16, 24, 32, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::PREF_V8_V8_IMM8_ID32) {
        constexpr size_t SIZE = 9;
        constexpr std::array<uint8_t, 6> OFF{0, 16, 24, 32, 40, 72};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V16_V16) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 24, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_IMM4) {
        constexpr size_t SIZE = 2;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 12, 16};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_IMM4_ID16) {
        constexpr size_t SIZE = 4;
        constexpr std::array<uint8_t, 5> OFF{0, 8, 12, 16, 32};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_V4) {
        constexpr size_t SIZE = 2;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 12, 16};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_V4_ID16) {
        constexpr size_t SIZE = 4;
        constexpr std::array<uint8_t, 5> OFF{0, 8, 12, 16, 32};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_V4_IMM32) {
        constexpr size_t SIZE = 6;
        constexpr std::array<uint8_t, 5> OFF{0, 8, 12, 16, 48};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_V4_IMM8) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 5> OFF{0, 8, 12, 16, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_V4_V4_IMM4_ID16) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 7> OFF{0, 8, 12, 16, 20, 24, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V4_V4_V4_V4_ID16) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 7> OFF{0, 8, 12, 16, 20, 24, 40};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8) {
        constexpr size_t SIZE = 2;
        constexpr std::array<uint8_t, 3> OFF{0, 8, 16};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_ID16) {
        constexpr size_t SIZE = 4;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 16, 32};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_IMM16) {
        constexpr size_t SIZE = 4;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 16, 32};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_IMM32) {
        constexpr size_t SIZE = 6;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 16, 48};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_IMM64) {
        constexpr size_t SIZE = 10;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 16, 80};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_IMM8) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 16, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_V8) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 4> OFF{0, 8, 16, 24};
        static_assert(OFF.size() == sizeof...(args) + 1);
        std::array<uint8_t, SIZE> buf{};
        Span<uint8_t> bufSp(buf);
        Span<const uint8_t> offSp(OFF);
        EmitImpl(bufSp, offSp, args...);
        std::copy(buf.begin(), buf.end(), out);
        insn_len = SIZE;
    }

    return insn_len;
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Nop() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NOP);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mov(uint16_t v1, uint16_t v2) {
    [[maybe_unused]] auto v1_bitlen = GetBitLengthUnsigned(v1);
    [[maybe_unused]] auto v2_bitlen = GetBitLengthUnsigned(v2);

    if (v1_bitlen <= BitImmSize::BITSIZE_4 && v2_bitlen <= BitImmSize::BITSIZE_4) {
        pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_V4_V4, v1, v2);
        return;
    }

    if (v1_bitlen <= BitImmSize::BITSIZE_8 && v2_bitlen <= BitImmSize::BITSIZE_8) {
        pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_V8_V8, v1, v2);
        return;
    }

    if (v1_bitlen <= BitImmSize::BITSIZE_16 && v2_bitlen <= BitImmSize::BITSIZE_16) {
        pc_ += Emit<BytecodeInstruction::Format::V16_V16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_V16_V16, v1, v2);
        return;
    }
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::MovWide(uint16_t v1, uint16_t v2) {
    [[maybe_unused]] auto v1_bitlen = GetBitLengthUnsigned(v1);
    [[maybe_unused]] auto v2_bitlen = GetBitLengthUnsigned(v2);

    if (v1_bitlen <= BitImmSize::BITSIZE_4 && v2_bitlen <= BitImmSize::BITSIZE_4) {
        pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_64_V4_V4, v1, v2);
        return;
    }

    if (v1_bitlen <= BitImmSize::BITSIZE_16 && v2_bitlen <= BitImmSize::BITSIZE_16) {
        pc_ += Emit<BytecodeInstruction::Format::V16_V16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_64_V16_V16, v1, v2);
        return;
    }
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::MovObj(uint16_t v1, uint16_t v2) {
    [[maybe_unused]] auto v1_bitlen = GetBitLengthUnsigned(v1);
    [[maybe_unused]] auto v2_bitlen = GetBitLengthUnsigned(v2);

    if (v1_bitlen <= BitImmSize::BITSIZE_4 && v2_bitlen <= BitImmSize::BITSIZE_4) {
        pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_OBJ_V4_V4, v1, v2);
        return;
    }

    if (v1_bitlen <= BitImmSize::BITSIZE_8 && v2_bitlen <= BitImmSize::BITSIZE_8) {
        pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_OBJ_V8_V8, v1, v2);
        return;
    }

    if (v1_bitlen <= BitImmSize::BITSIZE_16 && v2_bitlen <= BitImmSize::BITSIZE_16) {
        pc_ += Emit<BytecodeInstruction::Format::V16_V16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_OBJ_V16_V16, v1, v2);
        return;
    }
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Movi(uint8_t v, int32_t imm) {
    [[maybe_unused]] auto v_bitlen = GetBitLengthUnsigned(v);
    auto imm_bitlen = GetBitLengthSigned(imm);

    if (v_bitlen <= BitImmSize::BITSIZE_4 && imm_bitlen <= BitImmSize::BITSIZE_4) {
        pc_ += Emit<BytecodeInstruction::Format::V4_IMM4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOVI_V4_IMM4, v, imm);
        return;
    }

    if (v_bitlen <= BitImmSize::BITSIZE_8 && imm_bitlen <= BitImmSize::BITSIZE_8) {
        pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOVI_V8_IMM8, v, imm);
        return;
    }

    if (v_bitlen <= BitImmSize::BITSIZE_8 && imm_bitlen <= BitImmSize::BITSIZE_16) {
        pc_ += Emit<BytecodeInstruction::Format::V8_IMM16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOVI_V8_IMM16, v, imm);
        return;
    }

    if (v_bitlen <= BitImmSize::BITSIZE_8 && imm_bitlen <= BitImmSize::BITSIZE_32) {
        pc_ += Emit<BytecodeInstruction::Format::V8_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOVI_V8_IMM32, v, imm);
        return;
    }
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::MoviWide(uint8_t v, int64_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM64>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOVI_64_V8_IMM64, v, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FmoviWide(uint8_t v, int64_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM64>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMOVI_64_V8_IMM64, v, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::MovNull(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_NULL_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Lda(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaObj(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_OBJ_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldai(int32_t imm) {
    auto imm_bitlen = GetBitLengthSigned(imm);

    if (imm_bitlen <= BitImmSize::BITSIZE_8) {
        pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDAI_IMM8, imm);
        return;
    }

    if (imm_bitlen <= BitImmSize::BITSIZE_16) {
        pc_ += Emit<BytecodeInstruction::Format::IMM16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDAI_IMM16, imm);
        return;
    }

    if (imm_bitlen <= BitImmSize::BITSIZE_32) {
        pc_ += Emit<BytecodeInstruction::Format::IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDAI_IMM32, imm);
        return;
    }
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaiWide(int64_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM64>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDAI_64_IMM64, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FldaiWide(int64_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM64>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FLDAI_64_IMM64, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaStr(uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_STR_ID32, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaConst(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_CONST_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaType(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_TYPE_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaNull() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_NULL);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Sta(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STA_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StaWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STA_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StaObj(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STA_OBJ_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CmpWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CMP_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FcmplWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FCMPL_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FcmpgWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FCMPG_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jmp(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JMP_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::JeqObj(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::JneObj(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::JeqzObj(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::JnezObj(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jeqz(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JEQZ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jnez(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JNEZ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jltz(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JLTZ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jgtz(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JGTZ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jlez(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JLEZ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jgez(const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JGEZ_IMM8, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jeq(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JEQ_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jne(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JNE_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jlt(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JLT_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jgt(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JGT_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jle(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JLE_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Jge(uint8_t v, const Label & label) {
    branches_.insert(std::make_pair(pc_, label));
    pc_ += Emit<BytecodeInstruction::Format::V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::JGE_V8_IMM8, v, 0);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FnegWide() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FNEG_64);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Neg() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NEG);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::NegWide() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NEG_64);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Add2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADD2_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Add2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADD2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Sub2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUB2_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Sub2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUB2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mul2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MUL2_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mul2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MUL2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fadd2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FADD2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fsub2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FSUB2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmul2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMUL2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fdiv2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FDIV2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmod2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMOD2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Div2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIV2_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Div2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIV2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mod2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOD2_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mod2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOD2_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Addi(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADDI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Subi(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUBI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Muli(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MULI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Andi(int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANDI_IMM32, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ori(int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ORI_IMM32, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shli(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHLI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shri(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHRI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashri(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHRI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Divi(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modi(int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODI_IMM8, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Add(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADD_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Sub(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUB_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mul(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MUL_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Div(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIV_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mod(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOD_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Inci(uint8_t v, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_IMM4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::INCI_V4_IMM4, v, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldarr8(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARR_8_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldarru8(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARRU_8_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldarr16(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARR_16_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldarru16(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARRU_16_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldarr(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARR_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdarrWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARR_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fldarr32(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FLDARR_32_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FldarrWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FLDARR_64_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdarrObj(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDARR_OBJ_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Starr8(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STARR_8_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Starr16(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STARR_16_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Starr(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STARR_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StarrWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STARR_64_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fstarr32(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FSTARR_32_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FstarrWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FSTARR_64_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StarrObj(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STARR_OBJ_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Lenarr(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LENARR_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Newarr(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NEWARR_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Newobj(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NEWOBJ_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::InitobjShort(uint16_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::INITOBJ_SHORT_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Initobj(uint16_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::INITOBJ_V4_V4_V4_V4_ID16, v1, v2, v3, v4, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::InitobjRange(uint16_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::INITOBJ_RANGE_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldobj(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDOBJ_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdobjWide(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDOBJ_64_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdobjObj(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDOBJ_OBJ_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Stobj(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STOBJ_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StobjWide(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STOBJ_64_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StobjObj(uint8_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STOBJ_OBJ_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdobjV(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDOBJ_V_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdobjVWide(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDOBJ_V_64_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdobjVObj(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDOBJ_V_OBJ_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StobjV(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STOBJ_V_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StobjVWide(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STOBJ_V_64_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StobjVObj(uint8_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STOBJ_V_OBJ_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ldstatic(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDSTATIC_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdstaticWide(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDSTATIC_64_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdstaticObj(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDSTATIC_OBJ_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ststatic(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STSTATIC_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StstaticWide(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STSTATIC_64_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StstaticObj(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STSTATIC_OBJ_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Return() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::RETURN);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::ReturnWide() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::RETURN_64);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::ReturnObj() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::RETURN_OBJ);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::ReturnVoid() {
    pc_ += Emit<BytecodeInstruction::Format::NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::RETURN_VOID);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Throw(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::THROW_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Checkcast(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CHECKCAST_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Isinstance(uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ISINSTANCE_ID16, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallShort(uint16_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_SHORT_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Call(uint16_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_V4_V4_V4_V4_ID16, v1, v2, v3, v4, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallRange(uint16_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_RANGE_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallAccShort(uint16_t v, int8_t imm, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_IMM4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_ACC_SHORT_V4_IMM4_ID16, v, imm, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallAcc(uint16_t v1, uint8_t v2, uint8_t v3, int8_t imm, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_V4_IMM4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_ACC_V4_V4_V4_IMM4_ID16, v1, v2, v3, imm, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallVirtShort(uint16_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_VIRT_SHORT_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallVirt(uint16_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_VIRT_V4_V4_V4_V4_ID16, v1, v2, v3, v4, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallVirtRange(uint16_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_VIRT_RANGE_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallVirtAccShort(uint16_t v, int8_t imm, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_IMM4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_VIRT_ACC_SHORT_V4_IMM4_ID16, v, imm, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::CallVirtAcc(uint16_t v1, uint8_t v2, uint8_t v3, int8_t imm, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_V4_IMM4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::CALL_VIRT_ACC_V4_V4_V4_IMM4_ID16, v1, v2, v3, imm, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::MovDyn(uint16_t v1, uint16_t v2) {
    [[maybe_unused]] auto v1_bitlen = GetBitLengthUnsigned(v1);
    [[maybe_unused]] auto v2_bitlen = GetBitLengthUnsigned(v2);

    if (v1_bitlen <= BitImmSize::BITSIZE_8 && v2_bitlen <= BitImmSize::BITSIZE_8) {
        pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_DYN_V8_V8, v1, v2);
        return;
    }

    if (v1_bitlen <= BitImmSize::BITSIZE_16 && v2_bitlen <= BitImmSize::BITSIZE_16) {
        pc_ += Emit<BytecodeInstruction::Format::V16_V16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOV_DYN_V16_V16, v1, v2);
        return;
    }
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaDyn(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDA_DYN_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::StaDyn(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::STA_DYN_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::LdaiDyn(int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::LDAI_DYN_IMM32, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::FldaiDyn(int64_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::IMM64>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FLDAI_DYN_IMM64, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Add2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADD2V_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Add2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADD2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Sub2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUB2V_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Sub2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUB2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mul2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MUL2V_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mul2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MUL2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fadd2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FADD2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fsub2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FSUB2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmul2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMUL2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fdiv2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FDIV2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmod2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMOD2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Div2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIV2V_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Div2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIV2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mod2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOD2V_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mod2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MOD2V_64_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Addiv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADDIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Subiv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUBIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Muliv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MULIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Andiv(uint8_t v1, uint8_t v2, int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANDIV_V4_V4_IMM32, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Oriv(uint8_t v1, uint8_t v2, int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ORIV_V4_V4_IMM32, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shliv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHLIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shriv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHRIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashriv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHRIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Diviv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modiv(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODIV_V4_V4_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Addv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ADDV_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Subv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SUBV_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Mulv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MULV_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Divv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVV_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODV_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyLdbyname(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_LDBYNAME_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmovi(uint8_t v, int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMOVI_PREF_V8_IMM32, v, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32tof64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOF64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ucmp(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::UCMP_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Not() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NOT_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsLdobjName(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_LDOBJ_NAME_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyLdbynameV(uint8_t v1, uint8_t v2, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_LDBYNAME_V_PREF_V8_V8_ID32, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fldai(int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FLDAI_PREF_IMM32, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32tof64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOF64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::UcmpWide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::UCMP_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::NotWide() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::NOT_64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsLdobjNameWide(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_LDOBJ_NAME_64_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyStbyname(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_STBYNAME_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fcmpl(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FCMPL_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I64tof64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I64TOF64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Divu2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVU2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::And2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::AND2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsLdobjNameObj(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_LDOBJ_NAME_OBJ_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyStbynameV(uint8_t v1, uint8_t v2, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_STBYNAME_V_PREF_V8_V8_ID32, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fcmpg(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FCMPG_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U64tof64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U64TOF64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Divu2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVU2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::And2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::AND2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsStobjName(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_STOBJ_NAME_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyLdbyidx(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_LDBYIDX_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fneg() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FNEG_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F64toi32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F64TOI32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modu2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODU2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Or2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::OR2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsStobjNameWide(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_STOBJ_NAME_64_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyStbyidx(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_STBYIDX_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fadd2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FADD2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F64toi64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F64TOI64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modu2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODU2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Or2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::OR2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsStobjNameObj(uint8_t v, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_STOBJ_NAME_OBJ_PREF_V8_ID32, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyLdbyval(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_LDBYVAL_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fsub2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FSUB2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F64tou32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F64TOU32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Divu2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVU2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xor2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XOR2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsCallNameShort(uint16_t v1, uint8_t v2, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_CALL_NAME_SHORT_PREF_V4_V4_ID16, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyStbyval(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_STBYVAL_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmul2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMUL2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F64tou64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F64TOU64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Divu2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::DIVU2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xor2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XOR2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsCallName(uint16_t v1, uint8_t v2, uint8_t v3, uint8_t v4, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4_V4_V4_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_CALL_NAME_PREF_V4_V4_V4_V4_ID16, v1, v2, v3, v4, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCall0(uint8_t v1) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_0_PREF_V8, v1);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fdiv2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FDIV2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32tou1() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOU1_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modu2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODU2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shl2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHL2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsCallNameRange(uint16_t v, uint16_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID16>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_CALL_NAME_RANGE_PREF_V8_ID16, v, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallRange(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_RANGE_PREF_V8_V8_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmod2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMOD2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I64tou1() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I64TOU1_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Modu2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::MODU2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shl2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHL2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsLdnullvalue() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_LDNULLVALUE_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallShort(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_SHORT_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32tof32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOF32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32tou1() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOU1_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shr2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHR2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsMovnullvalue(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_MOVNULLVALUE_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallThis0(uint32_t v1, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_THIS_0_PREF_V8_ID32, v1, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32tof32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOF32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U64tou1() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U64TOU1_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shr2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHR2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsIsnullvalue() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_ISNULLVALUE_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallThisRange(uint32_t v1, uint8_t v2, int8_t imm, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8_IMM8_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_THIS_RANGE_PREF_V8_V8_IMM8_ID32, v1, v2, imm, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I64tof32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I64TOF32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32toi64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOI64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashr2(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHR2_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsEquals(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_EQUALS_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallThisShort(uint32_t v1, uint8_t v2, uint32_t id) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4_ID32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_THIS_SHORT_PREF_V4_V4_ID32, v1, v2, id);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U64tof32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U64TOF32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32toi16() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOI16_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashr2Wide(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHR2_64_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsStrictequals(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_STRICTEQUALS_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallNew0(uint8_t v1) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_NEW_0_PREF_V8, v1);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F32tof64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F32TOF64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32tou16() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOU16_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xori(int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XORI_PREF_IMM32, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsTypeof(uint8_t v1) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_TYPEOF_PREF_V8, v1);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallNewRange(uint8_t v1, uint8_t v2, int8_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8_IMM8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_NEW_RANGE_PREF_V8_V8_IMM8, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F32toi32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F32TOI32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32toi8() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOI8_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::And(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::AND_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsIstrue(uint8_t v) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_ISTRUE_PREF_V8, v);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyCallNewShort(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_CALL_NEW_SHORT_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F32toi64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F32TOI64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I32tou8() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I32TOU8_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Or(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::OR_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::EtsNullcheck() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ETS_NULLCHECK_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::AnyIsinstance(uint8_t v1) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANY_ISINSTANCE_PREF_V8, v1);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F32tou32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F32TOU32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::I64toi32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::I64TOI32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xor(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XOR_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F32tou64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F32TOU64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32toi64() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOI64_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shl(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHL_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::F64tof32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::F64TOF32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32toi16() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOI16_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shr(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHR_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fadd2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FADD2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32tou16() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOU16_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashr(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHR_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fsub2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FSUB2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32toi8() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOI8_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::And2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::AND2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmul2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMUL2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U32tou8() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U32TOU8_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::And2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::AND2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fdiv2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FDIV2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U64toi32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U64TOI32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Or2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::OR2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Fmod2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::FMOD2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::U64tou32() {
    pc_ += Emit<BytecodeInstruction::Format::PREF_NONE>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::U64TOU32_PREF_NONE);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Or2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::OR2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xor2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XOR2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xor2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XOR2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shl2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHL2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shl2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHL2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shr2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHR2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shr2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHR2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashr2v(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHR2V_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashr2vWide(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V8_V8>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHR2V_64_PREF_V8_V8, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xoriv(uint8_t v1, uint8_t v2, int32_t imm) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4_IMM32>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XORIV_PREF_V4_V4_IMM32, v1, v2, imm);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Andv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ANDV_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Orv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ORV_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Xorv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::XORV_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shlv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHLV_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Shrv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::SHRV_PREF_V4_V4, v1, v2);
}

// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::Ashrv(uint8_t v1, uint8_t v2) {
    pc_ += Emit<BytecodeInstruction::Format::PREF_V4_V4>(std::back_inserter(bytecode_), BytecodeInstruction::Opcode::ASHRV_PREF_V4_V4, v1, v2);
}


/* static */
// NOLINTNEXTLINE(readability-function-size,misc-definitions-in-headers)
size_t BytecodeEmitter::GetSizeByOpcode(BytecodeInstruction::Opcode opcode) {
    switch (opcode) {
    case BytecodeInstruction::Opcode::NOP:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_V16_V16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_64_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_64_V16_V16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_OBJ_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_OBJ_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_OBJ_V16_V16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOVI_V4_IMM4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOVI_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOVI_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOVI_V8_IMM32:
       return 6;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOVI_64_V8_IMM64:
       return 10;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMOVI_64_V8_IMM64:
       return 10;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_NULL_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_OBJ_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDAI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDAI_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDAI_IMM32:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDAI_64_IMM64:
       return 9;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FLDAI_64_IMM64:
       return 9;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_STR_ID32:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_CONST_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_TYPE_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_NULL:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STA_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STA_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STA_OBJ_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CMP_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FCMPL_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FCMPG_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JMP_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JMP_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JMP_IMM32:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQZ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNEZ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLTZ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGTZ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLEZ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGEZ_IMM16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JEQ_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JNE_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLT_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGT_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JLE_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::JGE_V8_IMM16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FNEG_64:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::NEG:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::NEG_64:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADD2_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADD2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUB2_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUB2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MUL2_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MUL2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FADD2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FSUB2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMUL2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FDIV2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMOD2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIV2_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIV2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOD2_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOD2_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADDI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUBI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MULI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANDI_IMM32:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ORI_IMM32:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHLI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHRI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHRI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODI_IMM8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADD_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUB_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MUL_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOD_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::INCI_V4_IMM4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARR_8_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARRU_8_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARR_16_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARRU_16_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARR_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARR_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FLDARR_32_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FLDARR_64_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDARR_OBJ_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STARR_8_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STARR_16_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STARR_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STARR_64_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FSTARR_32_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FSTARR_64_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STARR_OBJ_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LENARR_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::NEWARR_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::NEWOBJ_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::INITOBJ_SHORT_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::INITOBJ_V4_V4_V4_V4_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::INITOBJ_RANGE_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDOBJ_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDOBJ_64_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDOBJ_OBJ_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STOBJ_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STOBJ_64_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STOBJ_OBJ_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDOBJ_V_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDOBJ_V_64_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDOBJ_V_OBJ_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STOBJ_V_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STOBJ_V_64_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STOBJ_V_OBJ_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDSTATIC_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDSTATIC_64_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDSTATIC_OBJ_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STSTATIC_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STSTATIC_64_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STSTATIC_OBJ_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::RETURN:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::RETURN_64:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::RETURN_OBJ:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::RETURN_VOID:
       return 1;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::THROW_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CHECKCAST_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ISINSTANCE_ID16:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_SHORT_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_V4_V4_V4_V4_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_RANGE_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_ACC_SHORT_V4_IMM4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_ACC_V4_V4_V4_IMM4_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_VIRT_SHORT_V4_V4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_VIRT_V4_V4_V4_V4_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_VIRT_RANGE_V8_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_VIRT_ACC_SHORT_V4_IMM4_ID16:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::CALL_VIRT_ACC_V4_V4_V4_IMM4_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_DYN_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOV_DYN_V16_V16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDA_DYN_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::STA_DYN_V8:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::LDAI_DYN_IMM32:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FLDAI_DYN_IMM64:
       return 9;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADD2V_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADD2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUB2V_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUB2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MUL2V_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MUL2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FADD2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FSUB2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMUL2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FDIV2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMOD2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIV2V_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIV2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOD2V_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MOD2V_64_V8_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADDIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUBIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MULIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANDIV_V4_V4_IMM32:
       return 6;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ORIV_V4_V4_IMM32:
       return 6;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHLIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHRIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHRIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODIV_V4_V4_IMM8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ADDV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SUBV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MULV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODV_V4_V4:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_LDBYNAME_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMOVI_PREF_V8_IMM32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOF64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::UCMP_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::NOT_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_LDOBJ_NAME_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_LDBYNAME_V_PREF_V8_V8_ID32:
       return 8;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FLDAI_PREF_IMM32:
       return 6;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOF64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::UCMP_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::NOT_64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_LDOBJ_NAME_64_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_STBYNAME_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FCMPL_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I64TOF64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVU2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::AND2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_LDOBJ_NAME_OBJ_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_STBYNAME_V_PREF_V8_V8_ID32:
       return 8;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FCMPG_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U64TOF64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVU2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::AND2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_STOBJ_NAME_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_LDBYIDX_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FNEG_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F64TOI32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODU2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::OR2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_STOBJ_NAME_64_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_STBYIDX_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FADD2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F64TOI64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODU2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::OR2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_STOBJ_NAME_OBJ_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_LDBYVAL_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FSUB2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F64TOU32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVU2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XOR2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_CALL_NAME_SHORT_PREF_V4_V4_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_STBYVAL_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMUL2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F64TOU64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::DIVU2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XOR2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_CALL_NAME_PREF_V4_V4_V4_V4_ID16:
       return 6;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_0_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FDIV2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOU1_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODU2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHL2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_CALL_NAME_RANGE_PREF_V8_ID16:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_RANGE_PREF_V8_V8_IMM8:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMOD2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I64TOU1_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::MODU2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHL2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_LDNULLVALUE_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_SHORT_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOF32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOU1_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHR2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_MOVNULLVALUE_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_THIS_0_PREF_V8_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOF32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U64TOU1_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHR2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_ISNULLVALUE_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_THIS_RANGE_PREF_V8_V8_IMM8_ID32:
       return 9;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I64TOF32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOI64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHR2_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_EQUALS_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_THIS_SHORT_PREF_V4_V4_ID32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U64TOF32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOI16_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHR2_64_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_STRICTEQUALS_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_NEW_0_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F32TOF64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOU16_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XORI_PREF_IMM32:
       return 6;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_TYPEOF_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_NEW_RANGE_PREF_V8_V8_IMM8:
       return 5;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F32TOI32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOI8_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::AND_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_ISTRUE_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_CALL_NEW_SHORT_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F32TOI64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I32TOU8_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::OR_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ETS_NULLCHECK_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANY_ISINSTANCE_PREF_V8:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F32TOU32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::I64TOI32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XOR_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F32TOU64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOI64_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHL_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::F64TOF32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOI16_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHR_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FADD2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOU16_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHR_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FSUB2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOI8_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::AND2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMUL2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U32TOU8_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::AND2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FDIV2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U64TOI32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::OR2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::FMOD2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::U64TOU32_PREF_NONE:
       return 2;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::OR2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XOR2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XOR2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHL2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHL2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHR2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHR2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHR2V_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHR2V_64_PREF_V8_V8:
       return 4;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XORIV_PREF_V4_V4_IMM32:
       return 7;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ANDV_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ORV_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::XORV_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHLV_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::SHRV_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    case BytecodeInstruction::Opcode::ASHRV_PREF_V4_V4:
       return 3;  // NOLINT(readability-magic-numbers)
    default:
        UNREACHABLE();
        return 0;
    }
}

template <Format FORMAT, typename OffsT>
static void UpdateBranchByFormat(uint8_t *insn, OffsT offs) { // NOLINT(readability-function-size)
    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM16) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 2> OFF{8, 24};
        Span<const uint8_t> offSp(OFF);
        Span<uint8_t> insnSp(insn, SIZE);
        EmitImpl(insnSp, offSp, offs);
        return;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM32) {
        constexpr size_t SIZE = 5;
        constexpr std::array<uint8_t, 2> OFF{8, 40};
        Span<const uint8_t> offSp(OFF);
        Span<uint8_t> insnSp(insn, SIZE);
        EmitImpl(insnSp, offSp, offs);
        return;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::IMM8) {
        constexpr size_t SIZE = 2;
        constexpr std::array<uint8_t, 2> OFF{8, 16};
        Span<const uint8_t> offSp(OFF);
        Span<uint8_t> insnSp(insn, SIZE);
        EmitImpl(insnSp, offSp, offs);
        return;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_IMM16) {
        constexpr size_t SIZE = 4;
        constexpr std::array<uint8_t, 2> OFF{16, 32};
        Span<const uint8_t> offSp(OFF);
        Span<uint8_t> insnSp(insn, SIZE);
        EmitImpl(insnSp, offSp, offs);
        return;
    }

    // Disable check due to clang-tidy bug https://bugs.llvm.org/show_bug.cgi?id=32203
    // NOLINTNEXTLINE(readability-braces-around-statements, bugprone-suspicious-semicolon)
    if constexpr (FORMAT == Format::V8_IMM8) {
        constexpr size_t SIZE = 3;
        constexpr std::array<uint8_t, 2> OFF{16, 24};
        Span<const uint8_t> offSp(OFF);
        Span<uint8_t> insnSp(insn, SIZE);
        EmitImpl(insnSp, offSp, offs);
        return;
    }

    UNREACHABLE();
}

/* static */
// NOLINTNEXTLINE(misc-definitions-in-headers)
void BytecodeEmitter::UpdateBranchOffs(uint8_t *insn, int32_t offs) {
    auto opcode = BytecodeInstruction(insn).GetOpcode();
    switch (opcode) {
    case BytecodeInstruction::Opcode::JMP_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JMP_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JMP_IMM32:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM32>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQZ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNEZ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLTZ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGTZ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLEZ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGEZ_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JNE_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLT_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGT_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JLE_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM8>(insn, offs);
        return;
    case BytecodeInstruction::Opcode::JGE_V8_IMM16:
        UpdateBranchByFormat<BytecodeInstruction::Format::V8_IMM16>(insn, offs);
        return;
    default:
        UNREACHABLE();
    }
}

/* static */
// NOLINTNEXTLINE(misc-definitions-in-headers)
BytecodeEmitter::BitImmSize BytecodeEmitter::GetBitImmSizeByOpcode(BytecodeInstruction::Opcode opcode) {
    switch (opcode) {
    case BytecodeInstruction::Opcode::JMP_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JMP_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JMP_IMM32:
        return BytecodeEmitter::BitImmSize::BITSIZE_32;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JEQZ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JNEZ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JLTZ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JGTZ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JLEZ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JGEZ_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JNE_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JLT_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JGT_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JLE_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
        return BytecodeEmitter::BitImmSize::BITSIZE_8;
    case BytecodeInstruction::Opcode::JGE_V8_IMM16:
        return BytecodeEmitter::BitImmSize::BITSIZE_16;
    default:
        UNREACHABLE();
        return BytecodeEmitter::BitImmSize::BITSIZE_32;  // Any return value will do, we are broken here anyway.
    }
}

/* static */
// NOLINTNEXTLINE(misc-definitions-in-headers)
BytecodeInstruction::Opcode BytecodeEmitter::RevertConditionCode(BytecodeInstruction::Opcode opcode) {
    switch (opcode) {
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
        return BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16:
        return BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
        return BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16:
        return BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
        return BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16:
        return BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
        return BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16:
        return BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16;
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
        return BytecodeInstruction::Opcode::JNEZ_IMM8;
    case BytecodeInstruction::Opcode::JEQZ_IMM16:
        return BytecodeInstruction::Opcode::JNEZ_IMM16;
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
        return BytecodeInstruction::Opcode::JEQZ_IMM8;
    case BytecodeInstruction::Opcode::JNEZ_IMM16:
        return BytecodeInstruction::Opcode::JEQZ_IMM16;
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
        return BytecodeInstruction::Opcode::JGEZ_IMM8;
    case BytecodeInstruction::Opcode::JLTZ_IMM16:
        return BytecodeInstruction::Opcode::JGEZ_IMM16;
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
        return BytecodeInstruction::Opcode::JLEZ_IMM8;
    case BytecodeInstruction::Opcode::JGTZ_IMM16:
        return BytecodeInstruction::Opcode::JLEZ_IMM16;
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
        return BytecodeInstruction::Opcode::JGTZ_IMM8;
    case BytecodeInstruction::Opcode::JLEZ_IMM16:
        return BytecodeInstruction::Opcode::JGTZ_IMM16;
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
        return BytecodeInstruction::Opcode::JLTZ_IMM8;
    case BytecodeInstruction::Opcode::JGEZ_IMM16:
        return BytecodeInstruction::Opcode::JLTZ_IMM16;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
        return BytecodeInstruction::Opcode::JNE_V8_IMM8;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM16:
        return BytecodeInstruction::Opcode::JNE_V8_IMM16;
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
        return BytecodeInstruction::Opcode::JEQ_V8_IMM8;
    case BytecodeInstruction::Opcode::JNE_V8_IMM16:
        return BytecodeInstruction::Opcode::JEQ_V8_IMM16;
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
        return BytecodeInstruction::Opcode::JGE_V8_IMM8;
    case BytecodeInstruction::Opcode::JLT_V8_IMM16:
        return BytecodeInstruction::Opcode::JGE_V8_IMM16;
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
        return BytecodeInstruction::Opcode::JLE_V8_IMM8;
    case BytecodeInstruction::Opcode::JGT_V8_IMM16:
        return BytecodeInstruction::Opcode::JLE_V8_IMM16;
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
        return BytecodeInstruction::Opcode::JGT_V8_IMM8;
    case BytecodeInstruction::Opcode::JLE_V8_IMM16:
        return BytecodeInstruction::Opcode::JGT_V8_IMM16;
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
        return BytecodeInstruction::Opcode::JLT_V8_IMM8;
    case BytecodeInstruction::Opcode::JGE_V8_IMM16:
        return BytecodeInstruction::Opcode::JLT_V8_IMM16;
    default:
        UNREACHABLE();
        return BytecodeInstruction::Opcode::LAST;  // Any return value will do, we are broken here anyway.
    }
}

/* static */
// NOLINTNEXTLINE(misc-definitions-in-headers)
BytecodeInstruction::Opcode BytecodeEmitter::GetLongestJump(BytecodeInstruction::Opcode opcode) {
    switch (opcode) {
    case BytecodeInstruction::Opcode::JMP_IMM8:
    case BytecodeInstruction::Opcode::JMP_IMM16:
    case BytecodeInstruction::Opcode::JMP_IMM32:
        return BytecodeInstruction::Opcode::JMP_IMM32;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16:
        return BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16:
        return BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16:
        return BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16:
        return BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16;
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
    case BytecodeInstruction::Opcode::JEQZ_IMM16:
        return BytecodeInstruction::Opcode::JEQZ_IMM16;
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
    case BytecodeInstruction::Opcode::JNEZ_IMM16:
        return BytecodeInstruction::Opcode::JNEZ_IMM16;
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
    case BytecodeInstruction::Opcode::JLTZ_IMM16:
        return BytecodeInstruction::Opcode::JLTZ_IMM16;
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
    case BytecodeInstruction::Opcode::JGTZ_IMM16:
        return BytecodeInstruction::Opcode::JGTZ_IMM16;
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
    case BytecodeInstruction::Opcode::JLEZ_IMM16:
        return BytecodeInstruction::Opcode::JLEZ_IMM16;
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
    case BytecodeInstruction::Opcode::JGEZ_IMM16:
        return BytecodeInstruction::Opcode::JGEZ_IMM16;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
    case BytecodeInstruction::Opcode::JEQ_V8_IMM16:
        return BytecodeInstruction::Opcode::JEQ_V8_IMM16;
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
    case BytecodeInstruction::Opcode::JNE_V8_IMM16:
        return BytecodeInstruction::Opcode::JNE_V8_IMM16;
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
    case BytecodeInstruction::Opcode::JLT_V8_IMM16:
        return BytecodeInstruction::Opcode::JLT_V8_IMM16;
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
    case BytecodeInstruction::Opcode::JGT_V8_IMM16:
        return BytecodeInstruction::Opcode::JGT_V8_IMM16;
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
    case BytecodeInstruction::Opcode::JLE_V8_IMM16:
        return BytecodeInstruction::Opcode::JLE_V8_IMM16;
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
    case BytecodeInstruction::Opcode::JGE_V8_IMM16:
        return BytecodeInstruction::Opcode::JGE_V8_IMM16;
    default:
        UNREACHABLE();
        return BytecodeInstruction::Opcode::LAST;  // Any return value will do, we are broken here anyway.
    }
}

/* static */
// // NOLINTNEXTLINE(readability-function-size,misc-definitions-in-headers)
BytecodeInstruction::Opcode BytecodeEmitter::GetSuitableJump(BytecodeInstruction::Opcode opcode, BytecodeEmitter::BitImmSize width) {
    switch (opcode) {
    case BytecodeInstruction::Opcode::JMP_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::JMP_IMM32;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JMP_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JMP_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JEQZ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JEQZ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JNEZ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JNEZ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JLTZ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JLTZ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JGTZ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JGTZ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JLEZ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JLEZ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JGEZ_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JGEZ_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JEQ_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JEQ_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JNE_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JNE_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JLT_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JLT_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JGT_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JGT_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JLE_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JLE_V8_IMM8;
        }
        break;
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
        switch (width) {
        case BytecodeEmitter::BitImmSize::BITSIZE_32:
            return BytecodeInstruction::Opcode::LAST;
        case BytecodeEmitter::BitImmSize::BITSIZE_16:
            return BytecodeInstruction::Opcode::JGE_V8_IMM16;
        case BytecodeEmitter::BitImmSize::BITSIZE_8:
        case BytecodeEmitter::BitImmSize::BITSIZE_4:
            return BytecodeInstruction::Opcode::JGE_V8_IMM8;
        }
        break;
    default:
        UNREACHABLE();
        return BytecodeInstruction::Opcode::LAST;  // Any return value will do, we are broken here anyway.
    }
    UNREACHABLE();
    return BytecodeInstruction::Opcode::LAST;  // Any return value will do, we are broken here anyway.
}

/* static */
// NOLINTNEXTLINE(misc-definitions-in-headers)
BytecodeInstruction::Opcode BytecodeEmitter::GetLowestSizeOp(BytecodeInstruction::Opcode opcode) {
    switch (opcode) {
    case BytecodeInstruction::Opcode::JMP_IMM8:
    case BytecodeInstruction::Opcode::JMP_IMM16:
    case BytecodeInstruction::Opcode::JMP_IMM32:
        return BytecodeInstruction::Opcode::JMP_IMM8;
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8:
    case BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM16:
        return BytecodeInstruction::Opcode::JEQ_OBJ_V8_IMM8;
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8:
    case BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM16:
        return BytecodeInstruction::Opcode::JNE_OBJ_V8_IMM8;
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8:
    case BytecodeInstruction::Opcode::JEQZ_OBJ_IMM16:
        return BytecodeInstruction::Opcode::JEQZ_OBJ_IMM8;
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8:
    case BytecodeInstruction::Opcode::JNEZ_OBJ_IMM16:
        return BytecodeInstruction::Opcode::JNEZ_OBJ_IMM8;
    case BytecodeInstruction::Opcode::JEQZ_IMM8:
    case BytecodeInstruction::Opcode::JEQZ_IMM16:
        return BytecodeInstruction::Opcode::JEQZ_IMM8;
    case BytecodeInstruction::Opcode::JNEZ_IMM8:
    case BytecodeInstruction::Opcode::JNEZ_IMM16:
        return BytecodeInstruction::Opcode::JNEZ_IMM8;
    case BytecodeInstruction::Opcode::JLTZ_IMM8:
    case BytecodeInstruction::Opcode::JLTZ_IMM16:
        return BytecodeInstruction::Opcode::JLTZ_IMM8;
    case BytecodeInstruction::Opcode::JGTZ_IMM8:
    case BytecodeInstruction::Opcode::JGTZ_IMM16:
        return BytecodeInstruction::Opcode::JGTZ_IMM8;
    case BytecodeInstruction::Opcode::JLEZ_IMM8:
    case BytecodeInstruction::Opcode::JLEZ_IMM16:
        return BytecodeInstruction::Opcode::JLEZ_IMM8;
    case BytecodeInstruction::Opcode::JGEZ_IMM8:
    case BytecodeInstruction::Opcode::JGEZ_IMM16:
        return BytecodeInstruction::Opcode::JGEZ_IMM8;
    case BytecodeInstruction::Opcode::JEQ_V8_IMM8:
    case BytecodeInstruction::Opcode::JEQ_V8_IMM16:
        return BytecodeInstruction::Opcode::JEQ_V8_IMM8;
    case BytecodeInstruction::Opcode::JNE_V8_IMM8:
    case BytecodeInstruction::Opcode::JNE_V8_IMM16:
        return BytecodeInstruction::Opcode::JNE_V8_IMM8;
    case BytecodeInstruction::Opcode::JLT_V8_IMM8:
    case BytecodeInstruction::Opcode::JLT_V8_IMM16:
        return BytecodeInstruction::Opcode::JLT_V8_IMM8;
    case BytecodeInstruction::Opcode::JGT_V8_IMM8:
    case BytecodeInstruction::Opcode::JGT_V8_IMM16:
        return BytecodeInstruction::Opcode::JGT_V8_IMM8;
    case BytecodeInstruction::Opcode::JLE_V8_IMM8:
    case BytecodeInstruction::Opcode::JLE_V8_IMM16:
        return BytecodeInstruction::Opcode::JLE_V8_IMM8;
    case BytecodeInstruction::Opcode::JGE_V8_IMM8:
    case BytecodeInstruction::Opcode::JGE_V8_IMM16:
        return BytecodeInstruction::Opcode::JGE_V8_IMM8;
    default:
        UNREACHABLE();
        return BytecodeInstruction::Opcode::LAST;  // Any return value will do, we are broken here anyway.
    }
}

// NOLINTEND(readability-identifier-naming)
