// This file is generated by Tools/cases_generator/optimizer_generator.py
// from:
//   Python/optimizer_bytecodes.c
// Do not edit!

        case _NOP: {
            break;
        }

        case _CHECK_PERIODIC: {
            break;
        }

        /* _CHECK_PERIODIC_AT_END is not a viable micro-op for tier 2 */

        case _CHECK_PERIODIC_IF_NOT_YIELD_FROM: {
            break;
        }

        /* _LOAD_BYTECODE is not a viable micro-op for tier 2 */

        case _RESUME_CHECK: {
            break;
        }

        /* _MONITOR_RESUME is not a viable micro-op for tier 2 */

        case _LOAD_FAST_CHECK: {
            JitOptRef value;
            value = GETLOCAL(oparg);
            if (sym_is_null(value)) {
                ctx->done = true;
            }
            assert(!PyJitRef_IsUnique(value));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_FAST: {
            JitOptRef value;
            value = GETLOCAL(oparg);
            assert(!PyJitRef_IsUnique(value));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_FAST_BORROW: {
            JitOptRef value;
            value = PyJitRef_Borrow(GETLOCAL(oparg));
            assert(!PyJitRef_IsUnique(value));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_FAST_AND_CLEAR: {
            JitOptRef value;
            value = GETLOCAL(oparg);
            JitOptRef temp = sym_new_null(ctx);
            GETLOCAL(oparg) = temp;
            assert(!PyJitRef_IsUnique(value));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_CONST: {
            JitOptRef value;
            PyCodeObject *co = get_current_code_object(ctx);
            PyObject *val = PyTuple_GET_ITEM(co->co_consts, oparg);
            ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);
            value = PyJitRef_Borrow(sym_new_const(ctx, val));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_SMALL_INT: {
            JitOptRef value;
            PyObject *val = PyLong_FromLong(oparg);
            assert(val);
            assert(_Py_IsImmortal(val));
            ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);
            value = PyJitRef_Borrow(sym_new_const(ctx, val));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _SWAP_FAST: {
            JitOptRef value;
            JitOptRef trash;
            value = stack_pointer[-1];
            JitOptRef tmp = GETLOCAL(oparg);
            GETLOCAL(oparg) = PyJitRef_RemoveUnique(value);
            trash = tmp;
            stack_pointer[-1] = trash;
            break;
        }

        case _POP_TOP: {
            JitOptRef value;
            value = stack_pointer[-1];
            PyTypeObject *typ = sym_get_type(value);
            if (PyJitRef_IsBorrowed(value) ||
                sym_is_immortal(PyJitRef_Unwrap(value)) ||
                sym_is_null(value)) {
                ADD_OP(_POP_TOP_NOP, 0, 0);
            }
            else if (typ == &PyLong_Type) {
                ADD_OP(_POP_TOP_INT, 0, 0);
            }
            else if (typ == &PyFloat_Type) {
                ADD_OP(_POP_TOP_FLOAT, 0, 0);
            }
            else if (typ == &PyUnicode_Type) {
                ADD_OP(_POP_TOP_UNICODE, 0, 0);
            }
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TOP_NOP: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TOP_INT: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (PyJitRef_IsBorrowed(value)) {
                ADD_OP(_POP_TOP_NOP, 0, 0);
            }
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TOP_FLOAT: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (PyJitRef_IsBorrowed(value)) {
                ADD_OP(_POP_TOP_NOP, 0, 0);
            }
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TOP_UNICODE: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (PyJitRef_IsBorrowed(value)) {
                ADD_OP(_POP_TOP_NOP, 0, 0);
            }
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TWO: {
            CHECK_STACK_BOUNDS(-2);
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _PUSH_NULL: {
            JitOptRef res;
            res = PyJitRef_Borrow(sym_new_null(ctx));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _END_FOR: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_ITER: {
            CHECK_STACK_BOUNDS(-2);
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _END_SEND: {
            JitOptRef val;
            val = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = val;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNARY_NEGATIVE: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            v = value;
            if (
                sym_is_safe_const(ctx, value)
            ) {
                JitOptRef value_sym = value;
                _PyStackRef value = sym_get_const_as_stackref(ctx, value_sym);
                _PyStackRef res_stackref;
                _PyStackRef v_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *res_o = PyNumber_Negative(PyStackRef_AsPyObjectBorrow(value));
                if (res_o == NULL) {
                    JUMP_TO_LABEL(error);
                }
                res_stackref = PyStackRef_FromPyObjectSteal(res_o);
                v_stackref = value;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)v_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_1_LOAD_CONST_INLINE_BORROW since we have one input and an immortal result
                        ADD_OP(_INSERT_1_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-1] = res;
                stack_pointer[0] = v;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            if (sym_matches_type(value, &PyFloat_Type) && PyJitRef_IsUnique(value)) {
                ADD_OP(_UNARY_NEGATIVE_FLOAT_INPLACE, 0, 0);
                v = PyJitRef_Borrow(sym_new_null(ctx));
                res = PyJitRef_MakeUnique(sym_new_type(ctx, &PyFloat_Type));
            }
            else if (sym_is_compact_int(value)) {
                res = sym_new_compact_int(ctx);
            }
            else {
                PyTypeObject *type = sym_get_type(value);
                if (type == &PyLong_Type || type == &PyFloat_Type) {
                    res = sym_new_type(ctx, type);
                }
                else {
                    res = sym_new_not_null(ctx);
                }
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNARY_NEGATIVE_FLOAT_INPLACE: {
            JitOptRef res;
            JitOptRef v;
            res = sym_new_not_null(ctx);
            v = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNARY_NOT: {
            JitOptRef value;
            JitOptRef res;
            value = stack_pointer[-1];
            if (
                sym_is_safe_const(ctx, value)
            ) {
                JitOptRef value_sym = value;
                _PyStackRef value = sym_get_const_as_stackref(ctx, value_sym);
                _PyStackRef res_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                assert(PyStackRef_BoolCheck(value));
                res_stackref = PyStackRef_IsFalse(value)
                ? PyStackRef_True : PyStackRef_False;
                /* End of uop copied from bytecodes for constant evaluation */
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _POP_TOP_LOAD_CONST_INLINE_BORROW since we have one input and an immortal result
                        ADD_OP(_POP_TOP_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                stack_pointer[-1] = res;
                break;
            }
            sym_set_type(value, &PyBool_Type);
            res = sym_new_truthiness(ctx, value, false);
            stack_pointer[-1] = res;
            break;
        }

        case _TO_BOOL: {
            JitOptRef value;
            JitOptRef res;
            value = stack_pointer[-1];
            int already_bool = optimize_to_bool(this_instr, ctx, value, &res, false);
            if (!already_bool) {
                res = sym_new_truthiness(ctx, value, true);
            }
            stack_pointer[-1] = res;
            break;
        }

        case _TO_BOOL_BOOL: {
            JitOptRef value;
            value = stack_pointer[-1];
            int already_bool = optimize_to_bool(this_instr, ctx, value, &value, false);
            if (!already_bool) {
                sym_set_type(value, &PyBool_Type);
            }
            stack_pointer[-1] = value;
            break;
        }

        case _TO_BOOL_INT: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            int already_bool = optimize_to_bool(this_instr, ctx, value, &res, true);
            if (!already_bool) {
                sym_set_type(value, &PyLong_Type);
                res = sym_new_truthiness(ctx, value, true);
            }
            v = value;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_NOS_LIST: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            if (sym_matches_type(nos, &PyList_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(nos, &PyList_Type);
            }
            break;
        }

        case _GUARD_TOS_LIST: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PyList_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PyList_Type);
            }
            break;
        }

        case _GUARD_TOS_SLICE: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PySlice_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PySlice_Type);
            }
            break;
        }

        case _TO_BOOL_LIST: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            int already_bool = optimize_to_bool(this_instr, ctx, value, &res, true);
            if (!already_bool) {
                res = sym_new_type(ctx, &PyBool_Type);
            }
            v = value;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _TO_BOOL_NONE: {
            JitOptRef value;
            JitOptRef res;
            value = stack_pointer[-1];
            int already_bool = optimize_to_bool(this_instr, ctx, value, &res, false);
            if (!already_bool) {
                sym_set_const(value, Py_None);
                res = sym_new_const(ctx, Py_False);
            }
            stack_pointer[-1] = res;
            break;
        }

        case _GUARD_NOS_COMPACT_ASCII: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            sym_set_type(nos, &PyUnicode_Type);
            break;
        }

        case _GUARD_NOS_UNICODE: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            if (sym_matches_type(nos, &PyUnicode_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            sym_set_type(nos, &PyUnicode_Type);
            break;
        }

        case _GUARD_TOS_UNICODE: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (sym_matches_type(value, &PyUnicode_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            sym_set_type(value, &PyUnicode_Type);
            break;
        }

        case _TO_BOOL_STR: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            int already_bool = optimize_to_bool(this_instr, ctx, value, &res, true);
            v = value;
            if (!already_bool) {
                res = sym_new_truthiness(ctx, value, true);
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _REPLACE_WITH_TRUE: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            ADD_OP(_INSERT_1_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)Py_True);
            res = sym_new_const(ctx, Py_True);
            v = value;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNARY_INVERT: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            v = value;
            if (!sym_matches_type(value, &PyBool_Type)) {
                if (
                    sym_is_safe_const(ctx, value)
                ) {
                    JitOptRef value_sym = value;
                    _PyStackRef value = sym_get_const_as_stackref(ctx, value_sym);
                    _PyStackRef res_stackref;
                    _PyStackRef v_stackref;
                    /* Start of uop copied from bytecodes for constant evaluation */
                    PyObject *res_o = PyNumber_Invert(PyStackRef_AsPyObjectBorrow(value));
                    if (res_o == NULL) {
                        JUMP_TO_LABEL(error);
                    }
                    res_stackref = PyStackRef_FromPyObjectSteal(res_o);
                    v_stackref = value;
                    /* End of uop copied from bytecodes for constant evaluation */
                    (void)v_stackref;
                    res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                    if (sym_is_const(ctx, res)) {
                        PyObject *result = sym_get_const(ctx, res);
                        if (_Py_IsImmortal(result)) {
                            // Replace with _INSERT_1_LOAD_CONST_INLINE_BORROW since we have one input and an immortal result
                            ADD_OP(_INSERT_1_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                        }
                    }
                    CHECK_STACK_BOUNDS(1);
                    stack_pointer[-1] = res;
                    stack_pointer[0] = v;
                    stack_pointer += 1;
                    ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                    break;
                }
            }
            if (sym_matches_type(value, &PyLong_Type)) {
                res = sym_new_type(ctx, &PyLong_Type);
            }
            else {
                res = sym_new_not_null(ctx);
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_NOS_INT: {
            JitOptRef left;
            left = stack_pointer[-2];
            if (sym_is_compact_int(left)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                if (sym_get_type(left) == &PyLong_Type) {
                    ADD_OP(_GUARD_NOS_OVERFLOWED, 0, 0);
                }
                sym_set_compact_int(left);
            }
            break;
        }

        case _GUARD_TOS_INT: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (sym_is_compact_int(value)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                if (sym_get_type(value) == &PyLong_Type) {
                    ADD_OP(_GUARD_TOS_OVERFLOWED, 0, 0);
                }
                sym_set_compact_int(value);
            }
            break;
        }

        case _GUARD_NOS_OVERFLOWED: {
            break;
        }

        case _GUARD_TOS_OVERFLOWED: {
            break;
        }

        case _BINARY_OP_MULTIPLY_INT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (PyJitRef_IsUnique(left)) {
                REPLACE_OP(this_instr, _BINARY_OP_MULTIPLY_INT_INPLACE, 0, 0);
            }
            else if (PyJitRef_IsUnique(right)) {
                REPLACE_OP(this_instr, _BINARY_OP_MULTIPLY_INT_INPLACE_RIGHT, 0, 0);
            }
            res = PyJitRef_MakeUnique(sym_new_compact_int(ctx));
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                assert(PyLong_CheckExact(left_o));
                assert(PyLong_CheckExact(right_o));
                assert(_PyLong_BothAreCompact((PyLongObject *)left_o, (PyLongObject *)right_o));
                STAT_INC(BINARY_OP, hit);
                res_stackref = _PyCompactLong_Multiply((PyLongObject *)left_o, (PyLongObject *)right_o);
                if (PyStackRef_IsNull(res_stackref )) {
                    ctx->done = true;
                    break;
                }
                l_stackref = left;
                r_stackref = right;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_INT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (PyJitRef_IsUnique(left)) {
                REPLACE_OP(this_instr, _BINARY_OP_ADD_INT_INPLACE, 0, 0);
            }
            else if (PyJitRef_IsUnique(right)) {
                REPLACE_OP(this_instr, _BINARY_OP_ADD_INT_INPLACE_RIGHT, 0, 0);
            }
            res = PyJitRef_MakeUnique(sym_new_compact_int(ctx));
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                assert(PyLong_CheckExact(left_o));
                assert(PyLong_CheckExact(right_o));
                assert(_PyLong_BothAreCompact((PyLongObject *)left_o, (PyLongObject *)right_o));
                STAT_INC(BINARY_OP, hit);
                res_stackref = _PyCompactLong_Add((PyLongObject *)left_o, (PyLongObject *)right_o);
                if (PyStackRef_IsNull(res_stackref )) {
                    ctx->done = true;
                    break;
                }
                l_stackref = left;
                r_stackref = right;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBTRACT_INT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (PyJitRef_IsUnique(left)) {
                REPLACE_OP(this_instr, _BINARY_OP_SUBTRACT_INT_INPLACE, 0, 0);
            }
            else if (PyJitRef_IsUnique(right)) {
                REPLACE_OP(this_instr, _BINARY_OP_SUBTRACT_INT_INPLACE_RIGHT, 0, 0);
            }
            res = PyJitRef_MakeUnique(sym_new_compact_int(ctx));
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                assert(PyLong_CheckExact(left_o));
                assert(PyLong_CheckExact(right_o));
                assert(_PyLong_BothAreCompact((PyLongObject *)left_o, (PyLongObject *)right_o));
                STAT_INC(BINARY_OP, hit);
                res_stackref = _PyCompactLong_Subtract((PyLongObject *)left_o, (PyLongObject *)right_o);
                if (PyStackRef_IsNull(res_stackref )) {
                    ctx->done = true;
                    break;
                }
                l_stackref = left;
                r_stackref = right;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_INT_INPLACE: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBTRACT_INT_INPLACE: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_MULTIPLY_INT_INPLACE: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_INT_INPLACE_RIGHT: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBTRACT_INT_INPLACE_RIGHT: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_MULTIPLY_INT_INPLACE_RIGHT: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_NOS_FLOAT: {
            JitOptRef left;
            left = stack_pointer[-2];
            if (sym_matches_type(left, &PyFloat_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            sym_set_type(left, &PyFloat_Type);
            break;
        }

        case _GUARD_TOS_FLOAT: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (sym_matches_type(value, &PyFloat_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            sym_set_type(value, &PyFloat_Type);
            break;
        }

        case _BINARY_OP_MULTIPLY_FLOAT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (PyJitRef_IsUnique(left)) {
                ADD_OP(_BINARY_OP_MULTIPLY_FLOAT_INPLACE, 0, 0);
                l = PyJitRef_Borrow(sym_new_null(ctx));
                r = right;
            }
            else if (PyJitRef_IsUnique(right)) {
                ADD_OP(_BINARY_OP_MULTIPLY_FLOAT_INPLACE_RIGHT, 0, 0);
                l = left;
                r = PyJitRef_Borrow(sym_new_null(ctx));
            }
            else {
                l = left;
                r = right;
            }
            res = PyJitRef_MakeUnique(sym_new_type(ctx, &PyFloat_Type));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_FLOAT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (PyJitRef_IsUnique(left)) {
                ADD_OP(_BINARY_OP_ADD_FLOAT_INPLACE, 0, 0);
                l = PyJitRef_Borrow(sym_new_null(ctx));
                r = right;
            }
            else if (PyJitRef_IsUnique(right)) {
                ADD_OP(_BINARY_OP_ADD_FLOAT_INPLACE_RIGHT, 0, 0);
                l = left;
                r = PyJitRef_Borrow(sym_new_null(ctx));
            }
            else {
                l = left;
                r = right;
            }
            res = PyJitRef_MakeUnique(sym_new_type(ctx, &PyFloat_Type));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBTRACT_FLOAT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (PyJitRef_IsUnique(left)) {
                ADD_OP(_BINARY_OP_SUBTRACT_FLOAT_INPLACE, 0, 0);
                l = PyJitRef_Borrow(sym_new_null(ctx));
                r = right;
            }
            else if (PyJitRef_IsUnique(right)) {
                ADD_OP(_BINARY_OP_SUBTRACT_FLOAT_INPLACE_RIGHT, 0, 0);
                l = left;
                r = PyJitRef_Borrow(sym_new_null(ctx));
            }
            else {
                l = left;
                r = right;
            }
            res = PyJitRef_MakeUnique(sym_new_type(ctx, &PyFloat_Type));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_FLOAT_INPLACE: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBTRACT_FLOAT_INPLACE: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_MULTIPLY_FLOAT_INPLACE: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_FLOAT_INPLACE_RIGHT: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_MULTIPLY_FLOAT_INPLACE_RIGHT: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBTRACT_FLOAT_INPLACE_RIGHT: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_ADD_UNICODE: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            res = sym_new_type(ctx, &PyUnicode_Type);
            l = left;
            r = right;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_INPLACE_ADD_UNICODE: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (sym_is_const(ctx, left) && sym_is_const(ctx, right)) {
                assert(PyUnicode_CheckExact(sym_get_const(ctx, left)));
                assert(PyUnicode_CheckExact(sym_get_const(ctx, right)));
                PyObject *temp = PyUnicode_Concat(sym_get_const(ctx, left), sym_get_const(ctx, right));
                if (temp == NULL) {
                    goto error;
                }
                res = sym_new_const(ctx, temp);
                CHECK_STACK_BOUNDS(-1);
                stack_pointer[-2] = res;
                stack_pointer += -1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                Py_DECREF(temp);
            }
            else {
                res = sym_new_type(ctx, &PyUnicode_Type);
                stack_pointer += -1;
            }
            GETLOCAL(this_instr->operand0) = sym_new_null(ctx);
            stack_pointer[-1] = res;
            break;
        }

        case _GUARD_BINARY_OP_EXTEND: {
            break;
        }

        case _BINARY_OP_EXTEND: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            PyObject *descr = (PyObject *)this_instr->operand0;
            _PyBinaryOpSpecializationDescr *d = (_PyBinaryOpSpecializationDescr *)descr;
            if (d != NULL && d->result_type != NULL) {
                res = sym_new_type(ctx, d->result_type);
                if (d->result_unique) {
                    res = PyJitRef_MakeUnique(res);
                }
            }
            else {
                res = sym_new_not_null(ctx);
            }
            l = left;
            r = right;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_SLICE: {
            JitOptRef container;
            JitOptRef res;
            container = stack_pointer[-3];
            PyTypeObject *type = sym_get_type(container);
            if (type == &PyUnicode_Type ||
                type == &PyList_Type ||
                type == &PyTuple_Type)
            {
                res = sym_new_type(ctx, type);
            }
            else {
                res = sym_new_not_null(ctx);
            }
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = res;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_SLICE: {
            CHECK_STACK_BOUNDS(-4);
            stack_pointer += -4;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_LIST_INT: {
            JitOptRef sub_st;
            JitOptRef list_st;
            JitOptRef res;
            JitOptRef ls;
            JitOptRef ss;
            sub_st = stack_pointer[-1];
            list_st = stack_pointer[-2];
            res = sym_new_unknown(ctx);
            ls = list_st;
            ss = sub_st;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = ls;
            stack_pointer[0] = ss;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_LIST_SLICE: {
            JitOptRef sub_st;
            JitOptRef list_st;
            JitOptRef res;
            JitOptRef ls;
            JitOptRef ss;
            sub_st = stack_pointer[-1];
            list_st = stack_pointer[-2];
            res = sym_new_type(ctx, &PyList_Type);
            ls = list_st;
            ss = sub_st;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = ls;
            stack_pointer[0] = ss;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_STR_INT: {
            JitOptRef sub_st;
            JitOptRef str_st;
            JitOptRef res;
            JitOptRef s;
            JitOptRef i;
            sub_st = stack_pointer[-1];
            str_st = stack_pointer[-2];
            res = sym_new_type(ctx, &PyUnicode_Type);
            s = str_st;
            i = sub_st;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = s;
            stack_pointer[0] = i;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_USTR_INT: {
            JitOptRef sub_st;
            JitOptRef str_st;
            JitOptRef res;
            JitOptRef s;
            JitOptRef i;
            sub_st = stack_pointer[-1];
            str_st = stack_pointer[-2];
            res = sym_new_type(ctx, &PyUnicode_Type);
            s = str_st;
            i = sub_st;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = s;
            stack_pointer[0] = i;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_NOS_TUPLE: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            if (sym_matches_type(nos, &PyTuple_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(nos, &PyTuple_Type);
            }
            break;
        }

        case _GUARD_TOS_TUPLE: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PyTuple_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PyTuple_Type);
            }
            break;
        }

        case _GUARD_BINARY_OP_SUBSCR_TUPLE_INT_BOUNDS: {
            JitOptRef sub_st;
            JitOptRef tuple_st;
            sub_st = stack_pointer[-1];
            tuple_st = stack_pointer[-2];
            assert(sym_matches_type(tuple_st, &PyTuple_Type));
            if (sym_is_const(ctx, sub_st)) {
                assert(PyLong_CheckExact(sym_get_const(ctx, sub_st)));
                long index = PyLong_AsLong(sym_get_const(ctx, sub_st));
                assert(index >= 0);
                Py_ssize_t tuple_length = sym_tuple_length(tuple_st);
                if (tuple_length != -1 && index < tuple_length) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            break;
        }

        case _BINARY_OP_SUBSCR_TUPLE_INT: {
            JitOptRef sub_st;
            JitOptRef tuple_st;
            JitOptRef res;
            JitOptRef ts;
            JitOptRef ss;
            sub_st = stack_pointer[-1];
            tuple_st = stack_pointer[-2];
            assert(sym_matches_type(tuple_st, &PyTuple_Type));
            if (sym_is_const(ctx, sub_st)) {
                assert(PyLong_CheckExact(sym_get_const(ctx, sub_st)));
                long index = PyLong_AsLong(sym_get_const(ctx, sub_st));
                assert(index >= 0);
                Py_ssize_t tuple_length = sym_tuple_length(tuple_st);
                if (tuple_length == -1) {
                    res = sym_new_not_null(ctx);
                }
                else {
                    assert(index < tuple_length);
                    res = sym_tuple_getitem(ctx, tuple_st, index);
                }
            }
            else {
                res = sym_new_not_null(ctx);
            }
            ts = tuple_st;
            ss = sub_st;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = ts;
            stack_pointer[0] = ss;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_NOS_DICT: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            if (sym_matches_type(nos, &PyDict_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            sym_set_type(nos, &PyDict_Type);
            break;
        }

        case _GUARD_NOS_ANY_DICT: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            PyTypeObject *tp = sym_get_type(nos);
            if (tp == &PyDict_Type || tp == &PyFrozenDict_Type) {
                ADD_OP(_NOP, 0, 0);
            }
            break;
        }

        case _GUARD_TOS_ANY_DICT: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            PyTypeObject *tp = sym_get_type(tos);
            if (tp == &PyDict_Type || tp == &PyFrozenDict_Type) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                tp = sym_get_probable_type(tos);
                if (tp == &PyDict_Type) {
                    ADD_OP(_GUARD_TOS_DICT, 0, 0);
                }
                else if (tp == &PyFrozenDict_Type) {
                    ADD_OP(_GUARD_TOS_FROZENDICT, 0, 0);
                }
            }
            break;
        }

        case _GUARD_TOS_DICT: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PyDict_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PyDict_Type);
            }
            break;
        }

        case _GUARD_TOS_FROZENDICT: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PyFrozenDict_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PyFrozenDict_Type);
            }
            break;
        }

        case _BINARY_OP_SUBSCR_DICT_KNOWN_HASH: {
            JitOptRef res;
            JitOptRef ds;
            JitOptRef ss;
            res = sym_new_not_null(ctx);
            ds = sym_new_not_null(ctx);
            ss = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = ds;
            stack_pointer[0] = ss;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_DICT: {
            JitOptRef sub_st;
            JitOptRef dict_st;
            JitOptRef res;
            JitOptRef ds;
            JitOptRef ss;
            sub_st = stack_pointer[-1];
            dict_st = stack_pointer[-2];
            PyObject *sub = sym_get_const(ctx, sub_st);
            if (sub != NULL) {
                optimize_dict_known_hash(ctx, dependencies, this_instr,
                                     sub, _BINARY_OP_SUBSCR_DICT_KNOWN_HASH);
            }
            res = sym_new_not_null(ctx);
            ds = dict_st;
            ss = sub_st;
            if (sym_is_not_container(sub_st) &&
                sym_matches_type(dict_st, &PyFrozenDict_Type)) {
                if (
                    sym_is_safe_const(ctx, dict_st) &&
                    sym_is_safe_const(ctx, sub_st)
                ) {
                    JitOptRef dict_st_sym = dict_st;
                    JitOptRef sub_st_sym = sub_st;
                    _PyStackRef dict_st = sym_get_const_as_stackref(ctx, dict_st_sym);
                    _PyStackRef sub_st = sym_get_const_as_stackref(ctx, sub_st_sym);
                    _PyStackRef res_stackref;
                    _PyStackRef ds_stackref;
                    _PyStackRef ss_stackref;
                    /* Start of uop copied from bytecodes for constant evaluation */
                    PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
                    PyObject *dict = PyStackRef_AsPyObjectBorrow(dict_st);
                    assert(PyAnyDict_CheckExact(dict));
                    STAT_INC(BINARY_OP, hit);
                    PyObject *res_o;
                    int rc = PyDict_GetItemRef(dict, sub, &res_o);
                    if (rc == 0) {
                        _PyErr_SetKeyError(sub);
                    }
                    if (rc <= 0) {
                        JUMP_TO_LABEL(error);
                    }
                    res_stackref = PyStackRef_FromPyObjectSteal(res_o);
                    ds_stackref = dict_st;
                    ss_stackref = sub_st;
                    /* End of uop copied from bytecodes for constant evaluation */
                    (void)ds_stackref;
                    (void)ss_stackref;
                    res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                    if (sym_is_const(ctx, res)) {
                        PyObject *result = sym_get_const(ctx, res);
                        if (_Py_IsImmortal(result)) {
                            // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                            ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                        }
                    }
                    CHECK_STACK_BOUNDS(1);
                    stack_pointer[-2] = res;
                    stack_pointer[-1] = ds;
                    stack_pointer[0] = ss;
                    stack_pointer += 1;
                    ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                    break;
                }
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = ds;
            stack_pointer[0] = ss;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_CHECK_FUNC: {
            JitOptRef container;
            JitOptRef getitem;
            container = stack_pointer[-2];
            getitem = sym_new_not_null(ctx);
            PyTypeObject *tp = sym_get_type(container);
            if (tp == NULL) {
                PyObject *c = sym_get_probable_value(container);
                if (c != NULL) {
                    tp = Py_TYPE(c);
                }
            }
            if (tp != NULL) {
                PyObject *getitem_o = ((PyHeapTypeObject *)tp)->_spec_cache.getitem;
                sym_set_recorded_value(getitem, getitem_o);
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = getitem;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP_SUBSCR_INIT_CALL: {
            JitOptRef getitem;
            JitOptRef sub;
            JitOptRef container;
            JitOptRef new_frame;
            getitem = stack_pointer[-1];
            sub = stack_pointer[-2];
            container = stack_pointer[-3];
            _Py_UOpsAbstractFrame *f = frame_new_from_symbol(ctx, getitem, NULL, 0);
            if (f == NULL) {
                break;
            }
            f->locals[0] = container;
            f->locals[1] = sub;
            new_frame = PyJitRef_WrapInvalid(f);
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = new_frame;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LIST_APPEND: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _SET_ADD: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_SUBSCR: {
            CHECK_STACK_BOUNDS(-3);
            stack_pointer += -3;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_SUBSCR_LIST_INT: {
            JitOptRef sub_st;
            JitOptRef list_st;
            JitOptRef value;
            JitOptRef ls;
            JitOptRef ss;
            sub_st = stack_pointer[-1];
            list_st = stack_pointer[-2];
            value = stack_pointer[-3];
            (void)value;
            ls = list_st;
            ss = sub_st;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-3] = ls;
            stack_pointer[-2] = ss;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_SUBSCR_DICT: {
            JitOptRef sub;
            JitOptRef dict_st;
            JitOptRef value;
            JitOptRef st;
            sub = stack_pointer[-1];
            dict_st = stack_pointer[-2];
            value = stack_pointer[-3];
            PyObject *sub_o = sym_get_const(ctx, sub);
            if (sub_o != NULL) {
                optimize_dict_known_hash(ctx, dependencies, this_instr,
                                     sub_o, _STORE_SUBSCR_DICT_KNOWN_HASH);
            }
            (void)value;
            st = dict_st;
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = st;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_SUBSCR_DICT_KNOWN_HASH: {
            JitOptRef st;
            st = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = st;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _DELETE_SUBSCR: {
            CHECK_STACK_BOUNDS(-2);
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CALL_INTRINSIC_1: {
            JitOptRef value;
            JitOptRef res;
            JitOptRef v;
            value = stack_pointer[-1];
            res = sym_new_not_null(ctx);
            v = value;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CALL_INTRINSIC_2: {
            JitOptRef value1_st;
            JitOptRef value2_st;
            JitOptRef res;
            JitOptRef vs1;
            JitOptRef vs2;
            value1_st = stack_pointer[-1];
            value2_st = stack_pointer[-2];
            res = sym_new_not_null(ctx);
            vs1 = value1_st;
            vs2 = value2_st;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = vs1;
            stack_pointer[0] = vs2;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MAKE_HEAP_SAFE: {
            JitOptRef value;
            value = stack_pointer[-1];
            if (sym_is_immortal(PyJitRef_Unwrap(value))) {
                ADD_OP(_NOP, 0, 0);
            }
            value = PyJitRef_StripBorrowInfo(value);
            stack_pointer[-1] = value;
            break;
        }

        case _RETURN_VALUE: {
            JitOptRef retval;
            JitOptRef res;
            retval = stack_pointer[-1];
            JitOptRef temp = retval;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            ctx->frame->stack_pointer = stack_pointer;
            assert(this_instr[1].opcode == _RECORD_CODE);
            PyCodeObject *returning_code = (PyCodeObject *)this_instr[1].operand0;
            assert(PyCode_Check(returning_code));
            if (returning_code == NULL) {
                ctx->done = true;
                break;
            }
            if (frame_pop(ctx, returning_code)) {
                break;
            }
            stack_pointer = ctx->frame->stack_pointer;
            res = temp;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GET_AITER: {
            JitOptRef iter;
            iter = sym_new_not_null(ctx);
            stack_pointer[-1] = iter;
            break;
        }

        case _GET_ANEXT: {
            JitOptRef awaitable;
            awaitable = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = awaitable;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GET_AWAITABLE: {
            JitOptRef iter;
            iter = sym_new_not_null(ctx);
            stack_pointer[-1] = iter;
            break;
        }

        /* _SEND is not a viable micro-op for tier 2 */

        case _SEND_GEN_FRAME: {
            JitOptRef v;
            JitOptRef receiver;
            JitOptRef gen_frame;
            v = stack_pointer[-1];
            receiver = stack_pointer[-3];
            _Py_UOpsAbstractFrame *new_frame = frame_new_from_symbol(ctx, receiver, NULL, 0);
            if (new_frame == NULL) {
                ctx->done = true;
                break;
            }
            new_frame->stack_pointer[0] = PyJitRef_StripReferenceInfo(v);
            new_frame->stack_pointer++;
            gen_frame = PyJitRef_WrapInvalid(new_frame);
            stack_pointer[-1] = gen_frame;
            break;
        }

        case _YIELD_VALUE: {
            JitOptRef retval;
            JitOptRef value;
            retval = stack_pointer[-1];
            JitOptRef temp = retval;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            ctx->frame->stack_pointer = stack_pointer;
            assert(this_instr[1].opcode == _RECORD_CODE);
            PyCodeObject *returning_code = (PyCodeObject *)this_instr[1].operand0;
            if (returning_code == NULL) {
                ctx->done = true;
                break;
            }
            assert(PyCode_Check(returning_code));
            if (frame_pop(ctx, returning_code)) {
                break;
            }
            stack_pointer = ctx->frame->stack_pointer;
            value = temp;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_EXCEPT: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_COMMON_CONSTANT: {
            JitOptRef value;
            assert(oparg < NUM_COMMON_CONSTANTS);
            PyObject *val = _PyInterpreterState_GET()->common_consts[oparg];
            ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);
            value = PyJitRef_Borrow(sym_new_const(ctx, val));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_BUILD_CLASS: {
            JitOptRef bc;
            bc = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = bc;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_NAME: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _DELETE_NAME: {
            break;
        }

        case _UNPACK_SEQUENCE: {
            JitOptRef *values;
            JitOptRef *top;
            values = &stack_pointer[-1];
            top = &stack_pointer[-1 + oparg];
            (void)top;
            for (int i = 0; i < oparg; i++) {
                values[i] = sym_new_unknown(ctx);
            }
            CHECK_STACK_BOUNDS(-1 + oparg);
            stack_pointer += -1 + oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_SEQUENCE_TWO_TUPLE: {
            JitOptRef seq;
            JitOptRef val1;
            JitOptRef val0;
            seq = stack_pointer[-1];
            if (PyJitRef_IsUnique(seq) && sym_tuple_length(seq) == 2) {
                ADD_OP(_UNPACK_SEQUENCE_UNIQUE_TWO_TUPLE, oparg, 0);
            }
            val0 = sym_tuple_getitem(ctx, seq, 0);
            val1 = sym_tuple_getitem(ctx, seq, 1);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = val1;
            stack_pointer[0] = val0;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_SEQUENCE_UNIQUE_TWO_TUPLE: {
            JitOptRef val1;
            JitOptRef val0;
            val1 = sym_new_not_null(ctx);
            val0 = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = val1;
            stack_pointer[0] = val0;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_SEQUENCE_UNIQUE_THREE_TUPLE: {
            JitOptRef val2;
            JitOptRef val1;
            JitOptRef val0;
            val2 = sym_new_not_null(ctx);
            val1 = sym_new_not_null(ctx);
            val0 = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(2);
            stack_pointer[-1] = val2;
            stack_pointer[0] = val1;
            stack_pointer[1] = val0;
            stack_pointer += 2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_SEQUENCE_TUPLE: {
            JitOptRef seq;
            JitOptRef *values;
            seq = stack_pointer[-1];
            values = &stack_pointer[-1];
            if (PyJitRef_IsUnique(seq) && sym_tuple_length(seq) == 3) {
                ADD_OP(_UNPACK_SEQUENCE_UNIQUE_THREE_TUPLE, oparg, 0);
            }
            else if (PyJitRef_IsUnique(seq) && sym_tuple_length(seq) == oparg) {
                ADD_OP(_UNPACK_SEQUENCE_UNIQUE_TUPLE, oparg, 0);
            }
            for (int i = 0; i < oparg; i++) {
                values[i] = sym_tuple_getitem(ctx, seq, oparg - i - 1);
            }
            CHECK_STACK_BOUNDS(-1 + oparg);
            stack_pointer += -1 + oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_SEQUENCE_UNIQUE_TUPLE: {
            JitOptRef *values;
            values = &stack_pointer[-1];
            for (int _i = oparg; --_i >= 0;) {
                values[_i] = sym_new_not_null(ctx);
            }
            CHECK_STACK_BOUNDS(-1 + oparg);
            stack_pointer += -1 + oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_SEQUENCE_LIST: {
            JitOptRef *values;
            values = &stack_pointer[-1];
            for (int _i = oparg; --_i >= 0;) {
                values[_i] = sym_new_not_null(ctx);
            }
            CHECK_STACK_BOUNDS(-1 + oparg);
            stack_pointer += -1 + oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _UNPACK_EX: {
            JitOptRef *values;
            JitOptRef *top;
            values = &stack_pointer[-1];
            top = &stack_pointer[(oparg & 0xFF) + (oparg >> 8)];
            (void)top;
            int totalargs = (oparg & 0xFF) + (oparg >> 8) + 1;
            for (int i = 0; i < totalargs; i++) {
                values[i] = sym_new_unknown(ctx);
            }
            CHECK_STACK_BOUNDS((oparg & 0xFF) + (oparg >> 8));
            stack_pointer += (oparg & 0xFF) + (oparg >> 8);
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_ATTR: {
            CHECK_STACK_BOUNDS(-2);
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _DELETE_ATTR: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_GLOBAL: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _DELETE_GLOBAL: {
            break;
        }

        case _LOAD_LOCALS: {
            JitOptRef locals;
            locals = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = locals;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        /* _LOAD_FROM_DICT_OR_GLOBALS is not a viable micro-op for tier 2 */

        case _LOAD_NAME: {
            JitOptRef v;
            v = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = v;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_GLOBAL: {
            JitOptRef *res;
            res = &stack_pointer[0];
            res[0] = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _PUSH_NULL_CONDITIONAL: {
            JitOptRef *null;
            null = &stack_pointer[0];
            if (oparg & 1) {
                ADD_OP(_PUSH_NULL, 0, 0);
                null[0] = sym_new_null(ctx);
            }
            else {
                ADD_OP(_NOP, 0, 0);
            }
            CHECK_STACK_BOUNDS((oparg & 1));
            stack_pointer += (oparg & 1);
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_GLOBALS_VERSION: {
            uint16_t version = (uint16_t)this_instr->operand0;
            if (ctx->frame->func != NULL) {
                PyObject *globals = ctx->frame->func->func_globals;
                if (incorrect_keys(globals, version)) {
                    OPT_STAT_INC(remove_globals_incorrect_keys);
                    ctx->done = true;
                }
                else if (get_mutations(globals) >= _Py_MAX_ALLOWED_GLOBALS_MODIFICATIONS) {
                }
                else {
                    if (!ctx->frame->globals_watched) {
                        PyDict_Watch(GLOBALS_WATCHER_ID, globals);
                        _Py_BloomFilter_Add(dependencies, globals);
                        ctx->frame->globals_watched = true;
                    }
                    if (ctx->frame->globals_checked_version == version) {
                        ADD_OP(_NOP, 0, 0);
                    }
                }
            }
            ctx->frame->globals_checked_version = version;
            break;
        }

        case _LOAD_GLOBAL_MODULE: {
            JitOptRef res;
            uint16_t version = (uint16_t)this_instr->operand0;
            uint16_t index = (uint16_t)this_instr->operand0;
            (void)index;
            PyObject *cnst = NULL;
            if (ctx->frame->func != NULL) {
                PyObject *globals = ctx->frame->func->func_globals;
                if (incorrect_keys(globals, version)) {
                    OPT_STAT_INC(remove_globals_incorrect_keys);
                    ctx->done = true;
                }
                else if (get_mutations(globals) >= _Py_MAX_ALLOWED_GLOBALS_MODIFICATIONS) {
                }
                else {
                    if (!ctx->frame->globals_watched) {
                        PyDict_Watch(GLOBALS_WATCHER_ID, globals);
                        _Py_BloomFilter_Add(dependencies, globals);
                        ctx->frame->globals_watched = true;
                    }
                    if (ctx->frame->globals_checked_version != version && this_instr[-1].opcode == _NOP) {
                        REPLACE_OP(uop_buffer_last(&ctx->out_buffer), _GUARD_GLOBALS_VERSION, 0, version);
                        ctx->frame->globals_checked_version = version;
                    }
                    if (ctx->frame->globals_checked_version == version) {
                        cnst = convert_global_to_const(this_instr, globals, false, false);
                    }
                }
            }
            if (cnst == NULL) {
                res = sym_new_not_null(ctx);
            }
            else {
                if (_Py_IsImmortal(cnst)) {
                    res = PyJitRef_Borrow(sym_new_const(ctx, cnst));
                }
                else {
                    res = sym_new_const(ctx, cnst);
                }
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_GLOBAL_BUILTINS: {
            JitOptRef res;
            uint16_t version = (uint16_t)this_instr->operand0;
            uint16_t index = (uint16_t)this_instr->operand0;
            (void)version;
            (void)index;
            PyObject *cnst = NULL;
            PyInterpreterState *interp = _PyInterpreterState_GET();
            PyObject *builtins = interp->builtins;
            if (incorrect_keys(builtins, version)) {
                OPT_STAT_INC(remove_globals_incorrect_keys);
                ctx->done = true;
            }
            else if (interp->rare_events.builtin_dict >= _Py_MAX_ALLOWED_BUILTINS_MODIFICATIONS) {
            }
            else {
                if (!ctx->builtins_watched) {
                    PyDict_Watch(BUILTINS_WATCHER_ID, builtins);
                    ctx->builtins_watched = true;
                }
                if (ctx->frame->globals_checked_version != 0 && ctx->frame->globals_watched) {
                    cnst = convert_global_to_const(this_instr, builtins, false, false);
                }
            }
            if (cnst == NULL) {
                res = sym_new_not_null(ctx);
            }
            else {
                if (_Py_IsImmortal(cnst)) {
                    res = PyJitRef_Borrow(sym_new_const(ctx, cnst));
                }
                else {
                    res = sym_new_const(ctx, cnst);
                }
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _DELETE_FAST: {
            break;
        }

        case _MAKE_CELL: {
            break;
        }

        case _DELETE_DEREF: {
            break;
        }

        case _LOAD_FROM_DICT_OR_DEREF: {
            JitOptRef value;
            value = sym_new_not_null(ctx);
            stack_pointer[-1] = value;
            break;
        }

        case _LOAD_DEREF: {
            JitOptRef value;
            value = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_DEREF: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _COPY_FREE_VARS: {
            PyCodeObject *co = get_current_code_object(ctx);
            if (co == NULL) {
                ctx->done = true;
                break;
            }
            int offset = co->co_nlocalsplus - oparg;
            for (int i = 0; i < oparg; ++i) {
                ctx->frame->locals[offset + i] = sym_new_not_null(ctx);
            }
            break;
        }

        case _BUILD_STRING: {
            JitOptRef str;
            str = sym_new_type(ctx, &PyUnicode_Type);
            CHECK_STACK_BOUNDS(1 - oparg);
            stack_pointer[-oparg] = str;
            stack_pointer += 1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BUILD_INTERPOLATION: {
            JitOptRef interpolation;
            interpolation = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - (oparg & 1));
            stack_pointer[-2 - (oparg & 1)] = interpolation;
            stack_pointer += -1 - (oparg & 1);
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BUILD_TEMPLATE: {
            JitOptRef template;
            template = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = template;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BUILD_TUPLE: {
            JitOptRef *values;
            JitOptRef tup;
            values = &stack_pointer[-oparg];
            tup = sym_new_tuple(ctx, oparg, values);
            tup = PyJitRef_MakeUnique(tup);
            CHECK_STACK_BOUNDS(1 - oparg);
            stack_pointer[-oparg] = tup;
            stack_pointer += 1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BUILD_LIST: {
            JitOptRef list;
            list = sym_new_type(ctx, &PyList_Type);
            CHECK_STACK_BOUNDS(1 - oparg);
            stack_pointer[-oparg] = list;
            stack_pointer += 1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LIST_EXTEND: {
            JitOptRef iterable_st;
            JitOptRef list_st;
            JitOptRef i;
            iterable_st = stack_pointer[-1];
            list_st = stack_pointer[-2 - (oparg-1)];
            (void)list_st;
            i = iterable_st;
            stack_pointer[-1] = i;
            break;
        }

        case _SET_UPDATE: {
            JitOptRef iterable;
            JitOptRef set;
            JitOptRef i;
            iterable = stack_pointer[-1];
            set = stack_pointer[-2 - (oparg-1)];
            (void)set;
            i = iterable;
            stack_pointer[-1] = i;
            break;
        }

        case _BUILD_SET: {
            JitOptRef set;
            set = sym_new_type(ctx, &PySet_Type);
            CHECK_STACK_BOUNDS(1 - oparg);
            stack_pointer[-oparg] = set;
            stack_pointer += 1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BUILD_MAP: {
            JitOptRef map;
            map = sym_new_type(ctx, &PyDict_Type);
            CHECK_STACK_BOUNDS(1 - oparg*2);
            stack_pointer[-oparg*2] = map;
            stack_pointer += 1 - oparg*2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _SETUP_ANNOTATIONS: {
            break;
        }

        case _DICT_UPDATE: {
            JitOptRef update;
            JitOptRef dict;
            JitOptRef upd;
            update = stack_pointer[-1];
            dict = stack_pointer[-2 - (oparg - 1)];
            (void)dict;
            upd = update;
            stack_pointer[-1] = upd;
            break;
        }

        case _DICT_MERGE: {
            JitOptRef update;
            JitOptRef dict;
            JitOptRef callable;
            JitOptRef u;
            update = stack_pointer[-1];
            dict = stack_pointer[-2 - (oparg - 1)];
            callable = stack_pointer[-5 - (oparg - 1)];
            (void)callable;
            (void)dict;
            u = update;
            stack_pointer[-1] = u;
            break;
        }

        case _MAP_ADD: {
            CHECK_STACK_BOUNDS(-2);
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_SUPER_ATTR_ATTR: {
            JitOptRef attr_st;
            attr_st = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = attr_st;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_SUPER_ATTR_METHOD: {
            JitOptRef attr;
            JitOptRef self_or_null;
            attr = sym_new_not_null(ctx);
            self_or_null = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-3] = attr;
            stack_pointer[-2] = self_or_null;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_ATTR: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef *self_or_null;
            owner = stack_pointer[-1];
            self_or_null = &stack_pointer[0];
            (void)owner;
            attr = sym_new_not_null(ctx);
            if (oparg & 1) {
                self_or_null[0] = sym_new_unknown(ctx);
            }
            CHECK_STACK_BOUNDS((oparg&1));
            stack_pointer[-1] = attr;
            stack_pointer += (oparg&1);
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_TYPE_VERSION: {
            JitOptRef owner;
            owner = stack_pointer[-1];
            uint32_t type_version = (uint32_t)this_instr->operand0;
            assert(type_version);
            assert(this_instr[-1].opcode == _RECORD_TOS_TYPE);
            if (sym_matches_type_version(owner, type_version)) {
                ADD_OP(_NOP, 0, 0);
            } else {
                PyTypeObject *type = _PyType_LookupByVersion(type_version);
                if (type) {
                    if (sym_set_type_version(owner, type_version)) {
                        PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
                        _Py_BloomFilter_Add(dependencies, type);
                    }
                }
            }
            break;
        }

        case _GUARD_TYPE_VERSION_LOCKED: {
            break;
        }

        case _CHECK_MANAGED_OBJECT_HAS_VALUES: {
            break;
        }

        case _LOAD_ATTR_INSTANCE_VALUE: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef o;
            owner = stack_pointer[-1];
            uint16_t offset = (uint16_t)this_instr->operand0;
            attr = sym_new_not_null(ctx);
            (void)offset;
            o = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = o;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_ATTR_MODULE: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef o;
            owner = stack_pointer[-1];
            uint32_t dict_version = (uint32_t)this_instr->operand0;
            uint16_t index = (uint16_t)this_instr->operand0;
            (void)dict_version;
            (void)index;
            attr = PyJitRef_NULL;
            if (sym_is_const(ctx, owner)) {
                PyModuleObject *mod = (PyModuleObject *)sym_get_const(ctx, owner);
                if (PyModule_CheckExact(mod)) {
                    PyObject *dict = mod->md_dict;
                    stack_pointer[-1] = attr;
                    uint64_t watched_mutations = get_mutations(dict);
                    if (watched_mutations < _Py_MAX_ALLOWED_GLOBALS_MODIFICATIONS) {
                        PyDict_Watch(GLOBALS_WATCHER_ID, dict);
                        _Py_BloomFilter_Add(dependencies, dict);
                        PyObject *res = convert_global_to_const(this_instr, dict, false, true);
                        if (res == NULL) {
                            attr = sym_new_not_null(ctx);
                        }
                        else {
                            attr = sym_new_const(ctx, res);
                        }
                    }
                }
            }
            if (PyJitRef_IsNull(attr)) {
                attr = sym_new_not_null(ctx);
            }
            o = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = o;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_ATTR_WITH_HINT: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef o;
            owner = stack_pointer[-1];
            uint16_t hint = (uint16_t)this_instr->operand0;
            attr = sym_new_not_null(ctx);
            (void)hint;
            o = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = o;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_ATTR_SLOT: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef o;
            owner = stack_pointer[-1];
            uint16_t index = (uint16_t)this_instr->operand0;
            attr = sym_new_not_null(ctx);
            (void)index;
            o = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = o;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_ATTR_CLASS: {
            JitOptRef owner;
            owner = stack_pointer[-1];
            uint32_t type_version = (uint32_t)this_instr->operand0;
            PyObject *type = (PyObject *)_PyType_LookupByVersion(type_version);
            if (type) {
                if (type == sym_get_const(ctx, owner)) {
                    ADD_OP(_NOP, 0, 0);
                }
                else {
                    sym_set_const(owner, type);
                }
            }
            break;
        }

        case _LOAD_ATTR_CLASS: {
            JitOptRef owner;
            JitOptRef attr;
            owner = stack_pointer[-1];
            PyObject *descr = (PyObject *)this_instr->operand0;
            (void)descr;
            PyTypeObject *type = (PyTypeObject *)sym_get_const(ctx, owner);
            PyObject *name = get_co_name(ctx, oparg >> 1);
            attr = lookup_attr(ctx, dependencies, this_instr, type, name,
                           _POP_TOP_LOAD_CONST_INLINE_BORROW,
                           _POP_TOP_LOAD_CONST_INLINE);
            stack_pointer[-1] = attr;
            break;
        }

        case _LOAD_ATTR_PROPERTY_FRAME: {
            JitOptRef owner;
            JitOptRef new_frame;
            owner = stack_pointer[-1];
            PyObject *fget = (PyObject *)this_instr->operand0;
            PyCodeObject *co = (PyCodeObject *)((PyFunctionObject *)fget)->func_code;
            _Py_UOpsAbstractFrame *f = frame_new(ctx, co, NULL, 0);
            if (f == NULL) {
                break;
            }
            f->locals[0] = owner;
            new_frame = PyJitRef_WrapInvalid(f);
            stack_pointer[-1] = new_frame;
            break;
        }

        /* _LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN is not a viable micro-op for tier 2 */

        case _GUARD_DORV_NO_DICT: {
            break;
        }

        case _STORE_ATTR_INSTANCE_VALUE: {
            JitOptRef owner;
            JitOptRef value;
            JitOptRef o;
            owner = stack_pointer[-1];
            value = stack_pointer[-2];
            uint16_t offset = (uint16_t)this_instr->operand0;
            (void)offset;
            (void)value;
            o = owner;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = o;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOCK_OBJECT: {
            break;
        }

        case _STORE_ATTR_WITH_HINT: {
            JitOptRef owner;
            JitOptRef value;
            JitOptRef o;
            owner = stack_pointer[-1];
            value = stack_pointer[-2];
            uint16_t hint = (uint16_t)this_instr->operand0;
            (void)hint;
            (void)value;
            o = owner;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = o;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _STORE_ATTR_SLOT: {
            JitOptRef owner;
            JitOptRef value;
            JitOptRef o;
            owner = stack_pointer[-1];
            value = stack_pointer[-2];
            uint16_t index = (uint16_t)this_instr->operand0;
            (void)index;
            (void)value;
            o = owner;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = o;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _COMPARE_OP: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                assert((oparg >> 5) <= Py_GE);
                PyObject *res_o = PyObject_RichCompare(left_o, right_o, oparg >> 5);
                if (res_o == NULL) {
                    goto error;
                }
                if (oparg & 16) {
                    int res_bool = PyObject_IsTrue(res_o);
                    Py_DECREF(res_o);
                    if (res_bool < 0) {
                        goto error;
                    }
                    res_stackref = res_bool ? PyStackRef_True : PyStackRef_False;
                }
                else {
                    res_stackref = PyStackRef_FromPyObjectSteal(res_o);
                }
                /* End of uop copied from bytecodes for constant evaluation */
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _POP_TWO_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_POP_TWO_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(-1);
                stack_pointer[-2] = res;
                stack_pointer += -1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            if (oparg & 16) {
                res = sym_new_type(ctx, &PyBool_Type);
            }
            else {
                res = _Py_uop_sym_new_not_null(ctx);
            }
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = res;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _COMPARE_OP_FLOAT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            int cmp_mask = oparg & (COMPARE_LT_MASK | COMPARE_GT_MASK | COMPARE_EQ_MASK);
            if (cmp_mask == COMPARE_EQ_MASK) {
                res = sym_new_predicate(ctx, left, right, JIT_PRED_EQ);
            }
            else if (cmp_mask == (COMPARE_LT_MASK | COMPARE_GT_MASK)) {
                res = sym_new_predicate(ctx, left, right, JIT_PRED_NE);
            }
            else {
                res = sym_new_type(ctx, &PyBool_Type);
            }
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                STAT_INC(COMPARE_OP, hit);
                double dleft = PyFloat_AS_DOUBLE(left_o);
                double dright = PyFloat_AS_DOUBLE(right_o);
                int sign_ish = COMPARISON_BIT(dleft, dright);
                l_stackref = left;
                r_stackref = right;
                res_stackref = (sign_ish & oparg) ? PyStackRef_True : PyStackRef_False;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _COMPARE_OP_INT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            int cmp_mask = oparg & (COMPARE_LT_MASK | COMPARE_GT_MASK | COMPARE_EQ_MASK);
            if (cmp_mask == COMPARE_EQ_MASK) {
                res = sym_new_predicate(ctx, left, right, JIT_PRED_EQ);
            }
            else if (cmp_mask == (COMPARE_LT_MASK | COMPARE_GT_MASK)) {
                res = sym_new_predicate(ctx, left, right, JIT_PRED_NE);
            }
            else {
                res = sym_new_type(ctx, &PyBool_Type);
            }
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                assert(_PyLong_IsCompact((PyLongObject *)left_o));
                assert(_PyLong_IsCompact((PyLongObject *)right_o));
                STAT_INC(COMPARE_OP, hit);
                assert(_PyLong_DigitCount((PyLongObject *)left_o) <= 1 &&
                   _PyLong_DigitCount((PyLongObject *)right_o) <= 1);
                Py_ssize_t ileft = _PyLong_CompactValue((PyLongObject *)left_o);
                Py_ssize_t iright = _PyLong_CompactValue((PyLongObject *)right_o);
                int sign_ish = COMPARISON_BIT(ileft, iright);
                l_stackref = left;
                r_stackref = right;
                res_stackref =  (sign_ish & oparg) ? PyStackRef_True : PyStackRef_False;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _COMPARE_OP_STR: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            res = sym_new_type(ctx, &PyBool_Type);
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                STAT_INC(COMPARE_OP, hit);
                int eq = _PyUnicode_Equal(left_o, right_o);
                assert((oparg >> 5) == Py_EQ || (oparg >> 5) == Py_NE);
                l_stackref = left;
                r_stackref = right;
                assert(eq == 0 || eq == 1);
                assert((oparg & 0xf) == COMPARISON_NOT_EQUALS || (oparg & 0xf) == COMPARISON_EQUALS);
                assert(COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS);
                res_stackref = ((COMPARISON_NOT_EQUALS + eq) & oparg) ? PyStackRef_True : PyStackRef_False;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _IS_OP: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef b;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            b = sym_new_predicate(ctx, left, right, (oparg ? JIT_PRED_IS_NOT : JIT_PRED_IS));
            l = left;
            r = right;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = b;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CONTAINS_OP: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef b;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            b = sym_new_type(ctx, &PyBool_Type);
            l = left;
            r = right;
            if (
                sym_is_safe_const(ctx, left) &&
                sym_is_safe_const(ctx, right)
            ) {
                JitOptRef left_sym = left;
                JitOptRef right_sym = right;
                _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                _PyStackRef b_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                int res = PySequence_Contains(right_o, left_o);
                if (res < 0) {
                    JUMP_TO_LABEL(error);
                }
                b_stackref = (res ^ oparg) ? PyStackRef_True : PyStackRef_False;
                l_stackref = left;
                r_stackref = right;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                b = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(b_stackref));
                if (sym_is_const(ctx, b)) {
                    PyObject *result = sym_get_const(ctx, b);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = b;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = b;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_TOS_ANY_SET: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            PyTypeObject *tp = sym_get_type(tos);
            if (tp == &PySet_Type || tp == &PyFrozenSet_Type) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                tp = sym_get_probable_type(tos);
                if (tp == &PySet_Type) {
                    ADD_OP(_GUARD_TOS_SET, 0, 0);
                }
                else if (tp == &PyFrozenSet_Type) {
                    ADD_OP(_GUARD_TOS_FROZENSET, 0, 0);
                }
            }
            break;
        }

        case _GUARD_TOS_SET: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PySet_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PySet_Type);
            }
            break;
        }

        case _GUARD_TOS_FROZENSET: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            if (sym_matches_type(tos, &PyFrozenSet_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(tos, &PyFrozenSet_Type);
            }
            break;
        }

        case _CONTAINS_OP_SET: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef b;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            b = sym_new_type(ctx, &PyBool_Type);
            l = left;
            r = right;
            if (sym_is_not_container(left) &&
                sym_matches_type(right, &PyFrozenSet_Type)) {
                if (
                    sym_is_safe_const(ctx, left) &&
                    sym_is_safe_const(ctx, right)
                ) {
                    JitOptRef left_sym = left;
                    JitOptRef right_sym = right;
                    _PyStackRef left = sym_get_const_as_stackref(ctx, left_sym);
                    _PyStackRef right = sym_get_const_as_stackref(ctx, right_sym);
                    _PyStackRef b_stackref;
                    _PyStackRef l_stackref;
                    _PyStackRef r_stackref;
                    /* Start of uop copied from bytecodes for constant evaluation */
                    PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
                    PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                    assert(PyAnySet_CheckExact(right_o));
                    STAT_INC(CONTAINS_OP, hit);
                    int res = _PySet_Contains((PySetObject *)right_o, left_o);
                    if (res < 0) {
                        JUMP_TO_LABEL(error);
                    }
                    b_stackref = (res ^ oparg) ? PyStackRef_True : PyStackRef_False;
                    l_stackref = left;
                    r_stackref = right;
                    /* End of uop copied from bytecodes for constant evaluation */
                    (void)l_stackref;
                    (void)r_stackref;
                    b = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(b_stackref));
                    if (sym_is_const(ctx, b)) {
                        PyObject *result = sym_get_const(ctx, b);
                        if (_Py_IsImmortal(result)) {
                            // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                            ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                        }
                    }
                    CHECK_STACK_BOUNDS(1);
                    stack_pointer[-2] = b;
                    stack_pointer[-1] = l;
                    stack_pointer[0] = r;
                    stack_pointer += 1;
                    ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                    break;
                }
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = b;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CONTAINS_OP_DICT: {
            JitOptRef right;
            JitOptRef left;
            JitOptRef b;
            JitOptRef l;
            JitOptRef r;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            b = sym_new_type(ctx, &PyBool_Type);
            l = left;
            r = right;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = b;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_EG_MATCH: {
            JitOptRef rest;
            JitOptRef match;
            rest = sym_new_not_null(ctx);
            match = sym_new_not_null(ctx);
            stack_pointer[-2] = rest;
            stack_pointer[-1] = match;
            break;
        }

        case _CHECK_EXC_MATCH: {
            JitOptRef b;
            b = sym_new_not_null(ctx);
            stack_pointer[-1] = b;
            break;
        }

        case _IMPORT_NAME: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = res;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _IMPORT_FROM: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        /* _POP_JUMP_IF_FALSE is not a viable micro-op for tier 2 */

        /* _POP_JUMP_IF_TRUE is not a viable micro-op for tier 2 */

        case _IS_NONE: {
            JitOptRef b;
            b = sym_new_not_null(ctx);
            stack_pointer[-1] = b;
            break;
        }

        /* _JUMP_BACKWARD_NO_INTERRUPT is not a viable micro-op for tier 2 */

        case _GET_LEN: {
            JitOptRef obj;
            JitOptRef len;
            obj = stack_pointer[-1];
            Py_ssize_t tuple_length = sym_tuple_length(obj);
            if (tuple_length == -1) {
                len = sym_new_type(ctx, &PyLong_Type);
            }
            else {
                assert(tuple_length >= 0);
                PyObject *temp = PyLong_FromSsize_t(tuple_length);
                if (temp == NULL) {
                    goto error;
                }
                if (_Py_IsImmortal(temp)) {
                    ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)temp);
                }
                len = sym_new_const(ctx, temp);
                CHECK_STACK_BOUNDS(1);
                stack_pointer[0] = len;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                Py_DECREF(temp);
                stack_pointer += -1;
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = len;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MATCH_CLASS: {
            JitOptRef names;
            JitOptRef type;
            JitOptRef subject;
            JitOptRef attrs;
            JitOptRef s;
            JitOptRef tp;
            JitOptRef n;
            names = stack_pointer[-1];
            type = stack_pointer[-2];
            subject = stack_pointer[-3];
            attrs = sym_new_not_null(ctx);
            s = subject;
            tp = type;
            n = names;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-3] = attrs;
            stack_pointer[-2] = s;
            stack_pointer[-1] = tp;
            stack_pointer[0] = n;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MATCH_MAPPING: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MATCH_SEQUENCE: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MATCH_KEYS: {
            JitOptRef values_or_none;
            values_or_none = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = values_or_none;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GET_ITER: {
            JitOptRef iterable;
            JitOptRef iter;
            JitOptRef index_or_null;
            iterable = stack_pointer[-1];
            if (sym_matches_type(iterable, &PyTuple_Type) || sym_matches_type(iterable, &PyList_Type)) {
                iter = iterable;
                index_or_null = sym_new_not_null(ctx);
            }
            else {
                iter = sym_new_not_null(ctx);
                index_or_null = sym_new_unknown(ctx);
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = iter;
            stack_pointer[0] = index_or_null;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        /* _FOR_ITER is not a viable micro-op for tier 2 */

        case _FOR_ITER_TIER_TWO: {
            JitOptRef next;
            next = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = next;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        /* _INSTRUMENTED_FOR_ITER is not a viable micro-op for tier 2 */

        case _ITER_CHECK_LIST: {
            JitOptRef iter;
            iter = stack_pointer[-2];
            if (sym_matches_type(iter, &PyList_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(iter, &PyList_Type);
            }
            break;
        }

        /* _ITER_JUMP_LIST is not a viable micro-op for tier 2 */

        case _GUARD_NOT_EXHAUSTED_LIST: {
            break;
        }

        /* _ITER_NEXT_LIST is not a viable micro-op for tier 2 */

        case _ITER_NEXT_LIST_TIER_TWO: {
            JitOptRef next;
            next = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = next;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _ITER_CHECK_TUPLE: {
            JitOptRef iter;
            iter = stack_pointer[-2];
            if (sym_matches_type(iter, &PyTuple_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            sym_set_type(iter, &PyTuple_Type);
            break;
        }

        /* _ITER_JUMP_TUPLE is not a viable micro-op for tier 2 */

        case _GUARD_NOT_EXHAUSTED_TUPLE: {
            break;
        }

        case _ITER_NEXT_TUPLE: {
            JitOptRef next;
            next = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = next;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _ITER_CHECK_RANGE: {
            JitOptRef iter;
            iter = stack_pointer[-2];
            if (sym_matches_type(iter, &PyRange_Type)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_type(iter, &PyRange_Type);
            }
            break;
        }

        /* _ITER_JUMP_RANGE is not a viable micro-op for tier 2 */

        case _GUARD_NOT_EXHAUSTED_RANGE: {
            break;
        }

        case _ITER_NEXT_RANGE: {
            JitOptRef next;
            next = sym_new_type(ctx, &PyLong_Type);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = next;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _FOR_ITER_GEN_FRAME: {
            JitOptRef iter;
            JitOptRef gen_frame;
            iter = stack_pointer[-2];
            _Py_UOpsAbstractFrame *new_frame = frame_new_from_symbol(ctx, iter, NULL, 0);
            if (new_frame == NULL) {
                ctx->done = true;
                break;
            }
            new_frame->stack_pointer[0] = sym_new_const(ctx, Py_None);
            new_frame->stack_pointer++;
            gen_frame = PyJitRef_WrapInvalid(new_frame);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = gen_frame;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _INSERT_NULL: {
            JitOptRef self;
            JitOptRef *method_and_self;
            self = stack_pointer[-1];
            method_and_self = &stack_pointer[-1];
            method_and_self[0] = sym_new_null(ctx);
            method_and_self[1] = self;
            CHECK_STACK_BOUNDS(1);
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_SPECIAL: {
            JitOptRef *method_and_self;
            method_and_self = &stack_pointer[-2];
            method_and_self[0] = sym_new_not_null(ctx);
            method_and_self[1] = sym_new_unknown(ctx);
            break;
        }

        case _WITH_EXCEPT_START: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _PUSH_EXC_INFO: {
            JitOptRef prev_exc;
            JitOptRef new_exc;
            prev_exc = sym_new_not_null(ctx);
            new_exc = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = prev_exc;
            stack_pointer[0] = new_exc;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT: {
            break;
        }

        case _GUARD_KEYS_VERSION: {
            break;
        }

        case _LOAD_ATTR_METHOD_WITH_VALUES: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef self;
            owner = stack_pointer[-1];
            PyObject *descr = (PyObject *)this_instr->operand0;
            (void)descr;
            PyTypeObject *type = sym_get_type(owner);
            PyObject *name = get_co_name(ctx, oparg >> 1);
            attr = lookup_attr(ctx, dependencies, this_instr, type, name,
                           _LOAD_CONST_UNDER_INLINE_BORROW,
                           _LOAD_CONST_UNDER_INLINE);
            self = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = self;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_ATTR_METHOD_NO_DICT: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef self;
            owner = stack_pointer[-1];
            PyObject *descr = (PyObject *)this_instr->operand0;
            (void)descr;
            PyTypeObject *type = sym_get_type(owner);
            PyObject *name = get_co_name(ctx, oparg >> 1);
            attr = lookup_attr(ctx, dependencies, this_instr, type, name,
                           _LOAD_CONST_UNDER_INLINE_BORROW,
                           _LOAD_CONST_UNDER_INLINE);
            self = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = self;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES: {
            JitOptRef owner;
            JitOptRef attr;
            owner = stack_pointer[-1];
            PyObject *descr = (PyObject *)this_instr->operand0;
            (void)descr;
            PyTypeObject *type = sym_get_type(owner);
            PyObject *name = get_co_name(ctx, oparg >> 1);
            attr = lookup_attr(ctx, dependencies, this_instr, type, name,
                           _POP_TOP_LOAD_CONST_INLINE_BORROW,
                           _POP_TOP_LOAD_CONST_INLINE);
            stack_pointer[-1] = attr;
            break;
        }

        case _LOAD_ATTR_NONDESCRIPTOR_NO_DICT: {
            JitOptRef owner;
            JitOptRef attr;
            owner = stack_pointer[-1];
            PyObject *descr = (PyObject *)this_instr->operand0;
            (void)descr;
            PyTypeObject *type = sym_get_type(owner);
            PyObject *name = get_co_name(ctx, oparg >> 1);
            attr = lookup_attr(ctx, dependencies, this_instr, type, name,
                           _POP_TOP_LOAD_CONST_INLINE_BORROW,
                           _POP_TOP_LOAD_CONST_INLINE);
            stack_pointer[-1] = attr;
            break;
        }

        case _CHECK_ATTR_METHOD_LAZY_DICT: {
            break;
        }

        case _LOAD_ATTR_METHOD_LAZY_DICT: {
            JitOptRef owner;
            JitOptRef attr;
            JitOptRef self;
            owner = stack_pointer[-1];
            PyObject *descr = (PyObject *)this_instr->operand0;
            (void)descr;
            PyTypeObject *type = sym_get_type(owner);
            PyObject *name = get_co_name(ctx, oparg >> 1);
            attr = lookup_attr(ctx, dependencies, this_instr, type, name,
                           _LOAD_CONST_UNDER_INLINE_BORROW,
                           _LOAD_CONST_UNDER_INLINE);
            self = owner;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = attr;
            stack_pointer[0] = self;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MAYBE_EXPAND_METHOD: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            (void)args;
            callable = sym_new_not_null(ctx);
            self_or_null = sym_new_not_null(ctx);
            stack_pointer[-2 - oparg] = callable;
            stack_pointer[-1 - oparg] = self_or_null;
            break;
        }

        /* _DO_CALL is not a viable micro-op for tier 2 */

        /* _MONITOR_CALL is not a viable micro-op for tier 2 */

        case _PY_FRAME_GENERAL: {
            JitOptRef callable;
            JitOptRef new_frame;
            callable = stack_pointer[-2 - oparg];
            new_frame = PyJitRef_WrapInvalid(frame_new_from_symbol(ctx, callable, NULL, 0));
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = new_frame;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_FUNCTION_VERSION: {
            JitOptRef callable;
            callable = stack_pointer[-2 - oparg];
            uint32_t func_version = (uint32_t)this_instr->operand0;
            if (sym_get_func_version(callable) == func_version) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            else {
                sym_set_func_version(ctx, callable, func_version);
            }
            break;
        }

        case _CHECK_FUNCTION_VERSION_INLINE: {
            break;
        }

        case _CHECK_METHOD_VERSION: {
            JitOptRef callable;
            callable = stack_pointer[-2 - oparg];
            uint32_t func_version = (uint32_t)this_instr->operand0;
            if (sym_is_const(ctx, callable) && sym_matches_type(callable, &PyMethod_Type)) {
                PyMethodObject *method = (PyMethodObject *)sym_get_const(ctx, callable);
                assert(PyMethod_Check(method));
                ADD_OP(_CHECK_FUNCTION_VERSION_INLINE, 0, func_version);
                uop_buffer_last(&ctx->out_buffer)->operand1 = (uintptr_t)method->im_func;
            }
            sym_set_type(callable, &PyMethod_Type);
            break;
        }

        case _EXPAND_METHOD: {
            break;
        }

        case _CHECK_IS_NOT_PY_CALLABLE: {
            break;
        }

        case _CALL_NON_PY_GENERAL: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_CALL_BOUND_METHOD_EXACT_ARGS: {
            JitOptRef null;
            JitOptRef callable;
            null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            sym_set_null(null);
            sym_set_type(callable, &PyMethod_Type);
            break;
        }

        case _INIT_CALL_BOUND_METHOD_EXACT_ARGS: {
            JitOptRef self_or_null;
            JitOptRef callable;
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            callable = sym_new_not_null(ctx);
            self_or_null = sym_new_not_null(ctx);
            stack_pointer[-2 - oparg] = callable;
            stack_pointer[-1 - oparg] = self_or_null;
            break;
        }

        case _CHECK_PEP_523: {
            if (_PyInterpreterState_GET()->eval_frame == NULL) {
                ADD_OP(_NOP, 0 ,0);
            }
            break;
        }

        case _CHECK_FUNCTION_EXACT_ARGS: {
            JitOptRef self_or_null;
            JitOptRef callable;
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            assert(sym_matches_type(callable, &PyFunction_Type));
            if (sym_is_const(ctx, callable)) {
                if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
                    PyFunctionObject *func = (PyFunctionObject *)sym_get_const(ctx, callable);
                    PyCodeObject *co = (PyCodeObject *)func->func_code;
                    if (co->co_argcount == oparg + sym_is_not_null(self_or_null)) {
                        ADD_OP(_NOP, 0 ,0);
                    }
                }
            }
            break;
        }

        case _CHECK_STACK_SPACE: {
            JitOptRef callable;
            callable = stack_pointer[-2 - oparg];
            PyCodeObject *co = sym_get_probable_func_code(callable);
            if (co == NULL) {
                ctx->done = true;
                break;
            }
            ADD_OP(_CHECK_STACK_SPACE_OPERAND, 0, co->co_framesize);
            break;
        }

        case _CHECK_RECURSION_REMAINING: {
            break;
        }

        case _INIT_CALL_PY_EXACT_ARGS: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            JitOptRef new_frame;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            int argcount = oparg;
            assert(!PyJitRef_IsNull(self_or_null));
            assert(args != NULL);
            if (sym_is_not_null(self_or_null)) {
                args--;
                argcount++;
            }
            if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
                new_frame = PyJitRef_WrapInvalid(frame_new_from_symbol(ctx, callable, args, argcount));
            } else {
                new_frame = PyJitRef_WrapInvalid(frame_new_from_symbol(ctx, callable, NULL, 0));
            }
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = new_frame;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _PUSH_FRAME: {
            JitOptRef new_frame;
            new_frame = stack_pointer[-1];
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            if (!CURRENT_FRAME_IS_INIT_SHIM()) {
                ctx->frame->stack_pointer = stack_pointer;
            }
            ctx->frame->caller = true;
            ctx->frame = (_Py_UOpsAbstractFrame *)PyJitRef_Unwrap(new_frame);
            ctx->curr_frame_depth++;
            stack_pointer = ctx->frame->stack_pointer;
            assert(ctx->frame->locals != NULL);
            break;
        }

        case _GUARD_NOS_NULL: {
            JitOptRef null;
            null = stack_pointer[-2];
            if (sym_is_null(null)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_null(null);
            }
            break;
        }

        case _GUARD_NOS_NOT_NULL: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            if (sym_is_not_null(nos)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_non_null(nos);
            }
            break;
        }

        case _GUARD_THIRD_NULL: {
            JitOptRef null;
            null = stack_pointer[-3];
            if (sym_is_null(null)) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_null(null);
            }
            break;
        }

        case _GUARD_CALLABLE_TYPE_1: {
            JitOptRef callable;
            callable = stack_pointer[-3];
            if (sym_get_const(ctx, callable) == (PyObject *)&PyType_Type) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_const(callable, (PyObject *)&PyType_Type);
            }
            break;
        }

        case _CALL_TYPE_1: {
            JitOptRef arg;
            JitOptRef res;
            JitOptRef a;
            arg = stack_pointer[-1];
            PyObject* type = (PyObject *)sym_get_type(arg);
            if (type) {
                res = sym_new_const(ctx, type);
                ADD_OP(_SHUFFLE_2_LOAD_CONST_INLINE_BORROW, 0,
                   (uintptr_t)type);
            }
            else {
                res = sym_new_not_null(ctx);
            }
            a = arg;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-3] = res;
            stack_pointer[-2] = a;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_STR_1: {
            JitOptRef callable;
            callable = stack_pointer[-3];
            if (sym_get_const(ctx, callable) == (PyObject *)&PyUnicode_Type) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_const(callable, (PyObject *)&PyUnicode_Type);
            }
            break;
        }

        case _CALL_STR_1: {
            JitOptRef arg;
            JitOptRef res;
            JitOptRef a;
            arg = stack_pointer[-1];
            if (sym_matches_type(arg, &PyUnicode_Type)) {
                res = PyJitRef_StripReferenceInfo(arg);
            }
            else {
                res = sym_new_type(ctx, &PyUnicode_Type);
            }
            a = arg;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-3] = res;
            stack_pointer[-2] = a;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_TUPLE_1: {
            JitOptRef callable;
            callable = stack_pointer[-3];
            if (sym_get_const(ctx, callable) == (PyObject *)&PyTuple_Type) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_const(callable, (PyObject *)&PyTuple_Type);
            }
            break;
        }

        case _CALL_TUPLE_1: {
            JitOptRef arg;
            JitOptRef res;
            JitOptRef a;
            arg = stack_pointer[-1];
            if (sym_matches_type(arg, &PyTuple_Type)) {
                res = PyJitRef_StripReferenceInfo(arg);
            }
            else {
                res = sym_new_type(ctx, &PyTuple_Type);
            }
            a = arg;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-3] = res;
            stack_pointer[-2] = a;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_AND_ALLOCATE_OBJECT: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            uint32_t type_version = (uint32_t)this_instr->operand0;
            (void)type_version;
            (void)args;
            callable = sym_new_not_null(ctx);
            self_or_null = sym_new_not_null(ctx);
            stack_pointer[-2 - oparg] = callable;
            stack_pointer[-1 - oparg] = self_or_null;
            break;
        }

        case _CREATE_INIT_FRAME: {
            JitOptRef *args;
            JitOptRef self;
            JitOptRef init;
            JitOptRef init_frame;
            args = &stack_pointer[-oparg];
            self = stack_pointer[-1 - oparg];
            init = stack_pointer[-2 - oparg];
            ctx->frame->stack_pointer = stack_pointer - oparg - 2;
            _Py_UOpsAbstractFrame *shim = frame_new(ctx, (PyCodeObject *)&_Py_InitCleanup, NULL, 0);
            if (shim == NULL) {
                break;
            }
            shim->stack_pointer[0] = self;
            shim->stack_pointer++;
            assert((int)(shim->stack_pointer - shim->stack) == 1);
            ctx->frame = shim;
            ctx->curr_frame_depth++;
            assert((this_instr + 1)->opcode == _PUSH_FRAME);
            init_frame = PyJitRef_WrapInvalid(frame_new_from_symbol(ctx, init, args-1, oparg+1));
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = init_frame;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _EXIT_INIT_CHECK: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CALL_BUILTIN_CLASS: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_BUILTIN_O: {
            JitOptRef self_or_null;
            JitOptRef callable;
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyCFunction_Type) &&
                (sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
                int total_args = oparg;
                if (sym_is_not_null(self_or_null)) {
                    total_args++;
                }
                if (total_args == 1 && PyCFunction_GET_FLAGS(callable_o) == METH_O) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyCFunction_Type);
            }
            break;
        }

        case _CALL_BUILTIN_O: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            JitOptRef res;
            JitOptRef c;
            JitOptRef s;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            res = sym_new_not_null(ctx);
            c = callable;
            if (sym_is_not_null(self_or_null)) {
                args--;
                s = args[0];
            }
            else if (sym_is_null(self_or_null)) {
                s = args[0];
            }
            else {
                s = sym_new_unknown(ctx);
            }
            CHECK_STACK_BOUNDS(1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer[-1 - oparg] = c;
            stack_pointer[-oparg] = s;
            stack_pointer += 1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_BUILTIN_FAST: {
            JitOptRef callable;
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyCFunction_Type)) {
                if (PyCFunction_GET_FLAGS(callable_o) == METH_FASTCALL) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyCFunction_Type);
            }
            break;
        }

        case _CALL_BUILTIN_FAST: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_BUILTIN_FAST_WITH_KEYWORDS: {
            JitOptRef callable;
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyCFunction_Type)) {
                if (PyCFunction_GET_FLAGS(callable_o) == (METH_FASTCALL | METH_KEYWORDS)) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyCFunction_Type);
            }
            break;
        }

        case _CALL_BUILTIN_FAST_WITH_KEYWORDS: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_LEN: {
            JitOptRef callable;
            callable = stack_pointer[-3];
            PyObject *len = _PyInterpreterState_GET()->callable_cache.len;
            if (sym_get_const(ctx, callable) == len) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_const(callable, len);
            }
            break;
        }

        case _CALL_LEN: {
            JitOptRef arg;
            JitOptRef callable;
            JitOptRef res;
            JitOptRef a;
            JitOptRef c;
            arg = stack_pointer[-1];
            callable = stack_pointer[-3];
            res = sym_new_type(ctx, &PyLong_Type);
            Py_ssize_t length = sym_tuple_length(arg);
            if (length < 0 && sym_is_const(ctx, arg)) {
                PyObject *const_val = sym_get_const(ctx, arg);
                if (const_val != NULL) {
                    if (PyUnicode_CheckExact(const_val)) {
                        length = PyUnicode_GET_LENGTH(const_val);
                    }
                    else if (PyBytes_CheckExact(const_val)) {
                        CHECK_STACK_BOUNDS(-2);
                        stack_pointer[-3] = res;
                        stack_pointer += -2;
                        ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                        length = PyBytes_GET_SIZE(const_val);
                        stack_pointer += 2;
                    }
                }
            }
            if (length >= 0) {
                PyObject *temp = PyLong_FromSsize_t(length);
                if (temp == NULL) {
                    goto error;
                }
                if (_Py_IsImmortal(temp)) {
                    ADD_OP(_SHUFFLE_3_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)temp);
                }
                res = sym_new_const(ctx, temp);
                CHECK_STACK_BOUNDS(-2);
                stack_pointer[-3] = res;
                stack_pointer += -2;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                Py_DECREF(temp);
                stack_pointer += 2;
            }
            a = arg;
            c = callable;
            stack_pointer[-3] = res;
            stack_pointer[-2] = a;
            stack_pointer[-1] = c;
            break;
        }

        case _GUARD_CALLABLE_ISINSTANCE: {
            JitOptRef callable;
            callable = stack_pointer[-4];
            PyObject *isinstance = _PyInterpreterState_GET()->callable_cache.isinstance;
            if (sym_get_const(ctx, callable) == isinstance) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_const(callable, isinstance);
            }
            break;
        }

        case _CALL_ISINSTANCE: {
            JitOptRef cls;
            JitOptRef instance;
            JitOptRef res;
            cls = stack_pointer[-1];
            instance = stack_pointer[-2];
            res = sym_new_type(ctx, &PyBool_Type);
            PyTypeObject *inst_type = sym_get_type(instance);
            PyTypeObject *cls_o = (PyTypeObject *)sym_get_const(ctx, cls);
            if (inst_type && cls_o && sym_matches_type(cls, &PyType_Type)) {
                PyObject *out = Py_False;
                if (inst_type == cls_o || PyType_IsSubtype(inst_type, cls_o)) {
                    out = Py_True;
                }
                sym_set_const(res, out);
                ADD_OP(_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)out);
            }
            CHECK_STACK_BOUNDS(-3);
            stack_pointer[-4] = res;
            stack_pointer += -3;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_LIST_APPEND: {
            JitOptRef callable;
            callable = stack_pointer[-3];
            PyObject *list_append = _PyInterpreterState_GET()->callable_cache.list_append;
            if (sym_get_const(ctx, callable) == list_append) {
                ADD_OP(_NOP, 0, 0);
            }
            else {
                sym_set_const(callable, list_append);
            }
            break;
        }

        case _CALL_LIST_APPEND: {
            JitOptRef arg;
            JitOptRef self;
            JitOptRef callable;
            JitOptRef none;
            JitOptRef c;
            JitOptRef s;
            arg = stack_pointer[-1];
            self = stack_pointer[-2];
            callable = stack_pointer[-3];
            (void)(arg);
            c = callable;
            s = self;
            none = sym_new_const(ctx, Py_None);
            stack_pointer[-3] = none;
            stack_pointer[-2] = c;
            stack_pointer[-1] = s;
            break;
        }

        case _GUARD_CALLABLE_METHOD_DESCRIPTOR_O: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
                (sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
                int total_args = oparg;
                if (sym_is_not_null(self_or_null)) {
                    total_args++;
                }
                PyTypeObject *self_type = NULL;
                if (sym_is_not_null(self_or_null)) {
                    self_type = sym_get_type(self_or_null);
                }
                else {
                    self_type = sym_get_type(args[0]);
                }
                PyTypeObject *d_type = ((PyMethodDescrObject *)callable_o)->d_common.d_type;
                if (total_args == 2 &&
                    ((PyMethodDescrObject *)callable_o)->d_method->ml_flags == METH_O &&
                    self_type == d_type) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyMethodDescr_Type);
            }
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_O: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            JitOptRef res;
            JitOptRef c;
            JitOptRef s;
            JitOptRef a;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && Py_IS_TYPE(callable_o, &PyMethodDescr_Type)
                && sym_is_not_null(self_or_null)) {
                PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
                PyCFunction cfunc = method->d_method->ml_meth;
                ADD_OP(_CALL_METHOD_DESCRIPTOR_O_INLINE, oparg + 1, (uintptr_t)cfunc);
            }
            res = sym_new_not_null(ctx);
            c = callable;
            if (sym_is_not_null(self_or_null)) {
                args--;
                s = args[0];
                a = args[1];
            }
            else {
                s = sym_new_unknown(ctx);
                a = sym_new_unknown(ctx);
            }
            CHECK_STACK_BOUNDS(2 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer[-1 - oparg] = c;
            stack_pointer[-oparg] = s;
            stack_pointer[1 - oparg] = a;
            stack_pointer += 2 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_RECURSION_LIMIT: {
            if (ctx->frame->is_c_recursion_checked) {
                ADD_OP(_NOP, 0, 0);
            }
            ctx->frame->is_c_recursion_checked = true;
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_O_INLINE: {
            JitOptRef res;
            JitOptRef c;
            JitOptRef s;
            JitOptRef a;
            res = sym_new_not_null(ctx);
            c = sym_new_not_null(ctx);
            s = sym_new_not_null(ctx);
            a = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(3 - oparg);
            stack_pointer[-1 - oparg] = res;
            stack_pointer[-oparg] = c;
            stack_pointer[1 - oparg] = s;
            stack_pointer[2 - oparg] = a;
            stack_pointer += 3 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
                (sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
                int total_args = oparg;
                if (sym_is_not_null(self_or_null)) {
                    total_args++;
                }
                PyTypeObject *self_type = NULL;
                if (sym_is_not_null(self_or_null)) {
                    self_type = sym_get_type(self_or_null);
                }
                else {
                    self_type = sym_get_type(args[0]);
                }
                PyTypeObject *d_type = ((PyMethodDescrObject *)callable_o)->d_common.d_type;
                if (total_args != 0 &&
                    ((PyMethodDescrObject *)callable_o)->d_method->ml_flags == (METH_FASTCALL|METH_KEYWORDS) &&
                    self_type == d_type) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyMethodDescr_Type);
            }
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS: {
            JitOptRef self_or_null;
            JitOptRef callable;
            JitOptRef res;
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && Py_IS_TYPE(callable_o, &PyMethodDescr_Type)
                && sym_is_not_null(self_or_null)) {
                PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
                PyCFunction cfunc = method->d_method->ml_meth;
                ADD_OP(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_INLINE, oparg + 1, (uintptr_t)cfunc);
            }
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_INLINE: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-oparg);
            stack_pointer[-1 - oparg] = res;
            stack_pointer += -oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_METHOD_DESCRIPTOR_NOARGS: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
                (sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
                int total_args = oparg;
                if (sym_is_not_null(self_or_null)) {
                    total_args++;
                }
                PyTypeObject *self_type = NULL;
                if (sym_is_not_null(self_or_null)) {
                    self_type = sym_get_type(self_or_null);
                }
                else {
                    self_type = sym_get_type(args[0]);
                }
                PyTypeObject *d_type = ((PyMethodDescrObject *)callable_o)->d_common.d_type;
                if (total_args == 1 &&
                    ((PyMethodDescrObject *)callable_o)->d_method->ml_flags == METH_NOARGS &&
                    self_type == d_type) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyMethodDescr_Type);
            }
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_NOARGS: {
            JitOptRef self_or_null;
            JitOptRef callable;
            JitOptRef res;
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && Py_IS_TYPE(callable_o, &PyMethodDescr_Type)
                && sym_is_not_null(self_or_null)) {
                PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
                PyCFunction cfunc = method->d_method->ml_meth;
                ADD_OP(_CALL_METHOD_DESCRIPTOR_NOARGS_INLINE, oparg + 1, (uintptr_t)cfunc);
            }
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_NOARGS_INLINE: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-oparg);
            stack_pointer[-1 - oparg] = res;
            stack_pointer += -oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_CALLABLE_METHOD_DESCRIPTOR_FAST: {
            JitOptRef *args;
            JitOptRef self_or_null;
            JitOptRef callable;
            args = &stack_pointer[-oparg];
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
                (sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
                int total_args = oparg;
                if (sym_is_not_null(self_or_null)) {
                    total_args++;
                }
                PyTypeObject *self_type = NULL;
                if (sym_is_not_null(self_or_null)) {
                    self_type = sym_get_type(self_or_null);
                }
                else {
                    self_type = sym_get_type(args[0]);
                }
                PyTypeObject *d_type = ((PyMethodDescrObject *)callable_o)->d_common.d_type;
                if (total_args != 0 &&
                    ((PyMethodDescrObject *)callable_o)->d_method->ml_flags == METH_FASTCALL &&
                    self_type == d_type) {
                    ADD_OP(_NOP, 0, 0);
                }
            }
            else {
                sym_set_type(callable, &PyMethodDescr_Type);
            }
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_FAST: {
            JitOptRef self_or_null;
            JitOptRef callable;
            JitOptRef res;
            self_or_null = stack_pointer[-1 - oparg];
            callable = stack_pointer[-2 - oparg];
            PyObject *callable_o = sym_get_const(ctx, callable);
            if (callable_o && Py_IS_TYPE(callable_o, &PyMethodDescr_Type)
                && sym_is_not_null(self_or_null)) {
                PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
                PyCFunction cfunc = method->d_method->ml_meth;
                ADD_OP(_CALL_METHOD_DESCRIPTOR_FAST_INLINE, oparg + 1, (uintptr_t)cfunc);
            }
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1 - oparg);
            stack_pointer[-2 - oparg] = res;
            stack_pointer += -1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CALL_METHOD_DESCRIPTOR_FAST_INLINE: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-oparg);
            stack_pointer[-1 - oparg] = res;
            stack_pointer += -oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        /* _MONITOR_CALL_KW is not a viable micro-op for tier 2 */

        case _MAYBE_EXPAND_METHOD_KW: {
            break;
        }

        /* _DO_CALL_KW is not a viable micro-op for tier 2 */

        case _PY_FRAME_KW: {
            JitOptRef callable;
            JitOptRef new_frame;
            callable = stack_pointer[-3 - oparg];
            new_frame = PyJitRef_WrapInvalid(frame_new_from_symbol(ctx, callable, NULL, 0));
            CHECK_STACK_BOUNDS(-2 - oparg);
            stack_pointer[-3 - oparg] = new_frame;
            stack_pointer += -2 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_FUNCTION_VERSION_KW: {
            break;
        }

        case _CHECK_METHOD_VERSION_KW: {
            break;
        }

        case _EXPAND_METHOD_KW: {
            break;
        }

        case _CHECK_IS_NOT_PY_CALLABLE_KW: {
            break;
        }

        case _CALL_KW_NON_PY: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-2 - oparg);
            stack_pointer[-3 - oparg] = res;
            stack_pointer += -2 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MAKE_CALLARGS_A_TUPLE: {
            break;
        }

        /* _DO_CALL_FUNCTION_EX is not a viable micro-op for tier 2 */

        case _CHECK_IS_PY_CALLABLE_EX: {
            break;
        }

        case _PY_FRAME_EX: {
            JitOptRef func_st;
            JitOptRef ex_frame;
            func_st = stack_pointer[-4];
            ex_frame = PyJitRef_WrapInvalid(frame_new_from_symbol(ctx, func_st, NULL, 0));
            CHECK_STACK_BOUNDS(-3);
            stack_pointer[-4] = ex_frame;
            stack_pointer += -3;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CHECK_IS_NOT_PY_CALLABLE_EX: {
            break;
        }

        case _CALL_FUNCTION_EX_NON_PY_GENERAL: {
            JitOptRef result;
            result = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-3);
            stack_pointer[-4] = result;
            stack_pointer += -3;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _MAKE_FUNCTION: {
            JitOptRef func;
            func = sym_new_not_null(ctx);
            stack_pointer[-1] = func;
            break;
        }

        case _SET_FUNCTION_ATTRIBUTE: {
            JitOptRef func_out;
            func_out = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = func_out;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _RETURN_GENERATOR: {
            JitOptRef res;
            ctx->frame->stack_pointer = stack_pointer;
            assert(this_instr[1].opcode == _RECORD_CODE);
            PyCodeObject *returning_code = (PyCodeObject *)this_instr[1].operand0;
            if (returning_code == NULL) {
                ctx->done = true;
                break;
            }
            assert(PyCode_Check(returning_code));
            if (frame_pop(ctx, returning_code)) {
                break;
            }
            stack_pointer = ctx->frame->stack_pointer;
            res = sym_new_unknown(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = res;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BUILD_SLICE: {
            JitOptRef slice;
            slice = sym_new_type(ctx, &PySlice_Type);
            CHECK_STACK_BOUNDS(1 - oparg);
            stack_pointer[-oparg] = slice;
            stack_pointer += 1 - oparg;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _CONVERT_VALUE: {
            JitOptRef result;
            result = sym_new_not_null(ctx);
            stack_pointer[-1] = result;
            break;
        }

        case _FORMAT_SIMPLE: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            stack_pointer[-1] = res;
            break;
        }

        case _FORMAT_WITH_SPEC: {
            JitOptRef res;
            res = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = res;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _COPY: {
            JitOptRef bottom;
            JitOptRef top;
            bottom = stack_pointer[-1 - (oparg-1)];
            assert(oparg > 0);
            bottom = PyJitRef_RemoveUnique(bottom);
            top = bottom;
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1 - (oparg-1)] = bottom;
            stack_pointer[0] = top;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _BINARY_OP: {
            JitOptRef rhs;
            JitOptRef lhs;
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            rhs = stack_pointer[-1];
            lhs = stack_pointer[-2];
            l = lhs;
            r = rhs;
            if (
                sym_is_safe_const(ctx, lhs) &&
                sym_is_safe_const(ctx, rhs)
            ) {
                JitOptRef lhs_sym = lhs;
                JitOptRef rhs_sym = rhs;
                _PyStackRef lhs = sym_get_const_as_stackref(ctx, lhs_sym);
                _PyStackRef rhs = sym_get_const_as_stackref(ctx, rhs_sym);
                _PyStackRef res_stackref;
                _PyStackRef l_stackref;
                _PyStackRef r_stackref;
                /* Start of uop copied from bytecodes for constant evaluation */
                PyObject *lhs_o = PyStackRef_AsPyObjectBorrow(lhs);
                PyObject *rhs_o = PyStackRef_AsPyObjectBorrow(rhs);
                assert(_PyEval_BinaryOps[oparg]);
                PyObject *res_o = _PyEval_BinaryOps[oparg](lhs_o, rhs_o);
                if (res_o == NULL) {
                    JUMP_TO_LABEL(error);
                }
                res_stackref = PyStackRef_FromPyObjectSteal(res_o);
                l_stackref = lhs;
                r_stackref = rhs;
                /* End of uop copied from bytecodes for constant evaluation */
                (void)l_stackref;
                (void)r_stackref;
                res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
                if (sym_is_const(ctx, res)) {
                    PyObject *result = sym_get_const(ctx, res);
                    if (_Py_IsImmortal(result)) {
                        // Replace with _INSERT_2_LOAD_CONST_INLINE_BORROW since we have two inputs and an immortal result
                        ADD_OP(_INSERT_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
                    }
                }
                CHECK_STACK_BOUNDS(1);
                stack_pointer[-2] = res;
                stack_pointer[-1] = l;
                stack_pointer[0] = r;
                stack_pointer += 1;
                ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
                break;
            }
            bool lhs_int = sym_matches_type(lhs, &PyLong_Type);
            bool rhs_int = sym_matches_type(rhs, &PyLong_Type);
            bool lhs_float = sym_matches_type(lhs, &PyFloat_Type);
            bool rhs_float = sym_matches_type(rhs, &PyFloat_Type);
            if (!((lhs_int || lhs_float) && (rhs_int || rhs_float))) {
                res = sym_new_unknown(ctx);
            }
            else if (oparg == NB_POWER || oparg == NB_INPLACE_POWER) {
                if (rhs_float) {
                    res = sym_new_unknown(ctx);
                }
                else if (lhs_float) {
                    res = sym_new_type(ctx, &PyFloat_Type);
                }
                else if (!sym_is_const(ctx, rhs)) {
                    res = sym_new_unknown(ctx);
                }
                else if (_PyLong_IsNegative((PyLongObject *)sym_get_const(ctx, rhs))) {
                    res = sym_new_type(ctx, &PyFloat_Type);
                }
                else {
                    res = sym_new_type(ctx, &PyLong_Type);
                }
            }
            else if (oparg == NB_TRUE_DIVIDE || oparg == NB_INPLACE_TRUE_DIVIDE) {
                res = sym_new_type(ctx, &PyFloat_Type);
            }
            else if (lhs_int && rhs_int) {
                res = sym_new_type(ctx, &PyLong_Type);
            }
            else {
                res = sym_new_type(ctx, &PyFloat_Type);
            }
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _SWAP: {
            JitOptRef top;
            JitOptRef bottom;
            top = stack_pointer[-1];
            bottom = stack_pointer[-2 - (oparg-2)];
            JitOptRef temp = bottom;
            bottom = top;
            top = temp;
            assert(oparg >= 2);
            stack_pointer[-2 - (oparg-2)] = bottom;
            stack_pointer[-1] = top;
            break;
        }

        /* _INSTRUMENTED_LINE is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_INSTRUCTION is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_JUMP_FORWARD is not a viable micro-op for tier 2 */

        /* _MONITOR_JUMP_BACKWARD is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_NOT_TAKEN is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_POP_JUMP_IF_TRUE is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_POP_JUMP_IF_FALSE is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_POP_JUMP_IF_NONE is not a viable micro-op for tier 2 */

        /* _INSTRUMENTED_POP_JUMP_IF_NOT_NONE is not a viable micro-op for tier 2 */

        case _GUARD_IS_TRUE_POP: {
            JitOptRef flag;
            flag = stack_pointer[-1];
            sym_apply_predicate_narrowing(ctx, flag, true);
            if (sym_is_const(ctx, flag)) {
                PyObject *value = sym_get_const(ctx, flag);
                assert(value != NULL);
                eliminate_pop_guard(this_instr, ctx, value != Py_True);
            }
            else {
                int bit = get_test_bit_for_bools();
                if (bit) {
                    REPLACE_OP(this_instr,
                           test_bit_set_in_true(bit) ?
                           _GUARD_BIT_IS_SET_POP :
                        _GUARD_BIT_IS_UNSET_POP, bit, 0);
                }
            }
            sym_set_const(flag, Py_True);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_IS_FALSE_POP: {
            JitOptRef flag;
            flag = stack_pointer[-1];
            sym_apply_predicate_narrowing(ctx, flag, false);
            if (sym_is_const(ctx, flag)) {
                PyObject *value = sym_get_const(ctx, flag);
                assert(value != NULL);
                eliminate_pop_guard(this_instr, ctx, value != Py_False);
            }
            else {
                int bit = get_test_bit_for_bools();
                if (bit) {
                    REPLACE_OP(this_instr,
                           test_bit_set_in_true(bit) ?
                           _GUARD_BIT_IS_UNSET_POP :
                        _GUARD_BIT_IS_SET_POP, bit, 0);
                }
            }
            sym_set_const(flag, Py_False);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_BIT_IS_SET_POP: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_BIT_IS_UNSET_POP: {
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_IS_NONE_POP: {
            JitOptRef val;
            val = stack_pointer[-1];
            if (sym_is_const(ctx, val)) {
                PyObject *value = sym_get_const(ctx, val);
                assert(value != NULL);
                eliminate_pop_guard(this_instr, ctx, !Py_IsNone(value));
            }
            else if (sym_has_type(val)) {
                assert(!sym_matches_type(val, &_PyNone_Type));
                eliminate_pop_guard(this_instr, ctx, true);
            }
            sym_set_const(val, Py_None);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _GUARD_IS_NOT_NONE_POP: {
            JitOptRef val;
            val = stack_pointer[-1];
            if (sym_is_const(ctx, val)) {
                PyObject *value = sym_get_const(ctx, val);
                assert(value != NULL);
                eliminate_pop_guard(this_instr, ctx, Py_IsNone(value));
            }
            else if (sym_has_type(val)) {
                assert(!sym_matches_type(val, &_PyNone_Type));
                eliminate_pop_guard(this_instr, ctx, false);
            }
            CHECK_STACK_BOUNDS(-1);
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _JUMP_TO_TOP: {
            ctx->done = true;
            break;
        }

        case _SET_IP: {
            break;
        }

        case _CHECK_STACK_SPACE_OPERAND: {
            uint32_t framesize = (uint32_t)this_instr->operand0;
            (void)framesize;
            break;
        }

        case _SAVE_RETURN_OFFSET: {
            break;
        }

        case _EXIT_TRACE: {
            PyObject *exit_p = (PyObject *)this_instr->operand0;
            (void)exit_p;
            ctx->done = true;
            break;
        }

        case _DYNAMIC_EXIT: {
            break;
        }

        case _CHECK_VALIDITY: {
            break;
        }

        case _LOAD_CONST_INLINE: {
            JitOptRef value;
            PyObject *ptr = (PyObject *)this_instr->operand0;
            value = sym_new_const(ctx, ptr);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TOP_LOAD_CONST_INLINE: {
            JitOptRef value;
            PyObject *ptr = (PyObject *)this_instr->operand0;
            value = sym_new_const(ctx, ptr);
            stack_pointer[-1] = value;
            break;
        }

        case _LOAD_CONST_INLINE_BORROW: {
            JitOptRef value;
            PyObject *ptr = (PyObject *)this_instr->operand0;
            value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
            CHECK_STACK_BOUNDS(1);
            stack_pointer[0] = value;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_CALL: {
            CHECK_STACK_BOUNDS(-2);
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_CALL_ONE: {
            CHECK_STACK_BOUNDS(-3);
            stack_pointer += -3;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_CALL_TWO: {
            CHECK_STACK_BOUNDS(-4);
            stack_pointer += -4;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_TOP_LOAD_CONST_INLINE_BORROW: {
            JitOptRef value;
            PyObject *ptr = (PyObject *)this_instr->operand0;
            value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
            stack_pointer[-1] = value;
            break;
        }

        case _POP_TWO_LOAD_CONST_INLINE_BORROW: {
            JitOptRef value;
            value = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = value;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_CALL_LOAD_CONST_INLINE_BORROW: {
            JitOptRef value;
            PyObject *ptr = (PyObject *)this_instr->operand0;
            value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-2] = value;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW: {
            JitOptRef value;
            value = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(-2);
            stack_pointer[-3] = value;
            stack_pointer += -2;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _INSERT_1_LOAD_CONST_INLINE: {
            JitOptRef res;
            JitOptRef l;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = l;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _INSERT_1_LOAD_CONST_INLINE_BORROW: {
            JitOptRef res;
            JitOptRef l;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = res;
            stack_pointer[0] = l;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _INSERT_2_LOAD_CONST_INLINE_BORROW: {
            JitOptRef res;
            JitOptRef l;
            JitOptRef r;
            res = sym_new_not_null(ctx);
            l = sym_new_not_null(ctx);
            r = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-2] = res;
            stack_pointer[-1] = l;
            stack_pointer[0] = r;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW: {
            JitOptRef arg;
            JitOptRef res;
            JitOptRef a;
            arg = stack_pointer[-1];
            PyObject *ptr = (PyObject *)this_instr->operand0;
            res = PyJitRef_Borrow(sym_new_const(ctx, ptr));
            a = arg;
            CHECK_STACK_BOUNDS(-1);
            stack_pointer[-3] = res;
            stack_pointer[-2] = a;
            stack_pointer += -1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _SHUFFLE_3_LOAD_CONST_INLINE_BORROW: {
            JitOptRef res;
            JitOptRef a;
            JitOptRef c;
            res = sym_new_not_null(ctx);
            a = sym_new_not_null(ctx);
            c = sym_new_not_null(ctx);
            stack_pointer[-3] = res;
            stack_pointer[-2] = a;
            stack_pointer[-1] = c;
            break;
        }

        case _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW: {
            JitOptRef value;
            PyObject *ptr = (PyObject *)this_instr->operand0;
            value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
            CHECK_STACK_BOUNDS(-3);
            stack_pointer[-4] = value;
            stack_pointer += -3;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_CONST_UNDER_INLINE: {
            JitOptRef value;
            JitOptRef new;
            value = sym_new_not_null(ctx);
            new = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = value;
            stack_pointer[0] = new;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _LOAD_CONST_UNDER_INLINE_BORROW: {
            JitOptRef value;
            JitOptRef new;
            value = sym_new_not_null(ctx);
            new = sym_new_not_null(ctx);
            CHECK_STACK_BOUNDS(1);
            stack_pointer[-1] = value;
            stack_pointer[0] = new;
            stack_pointer += 1;
            ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
            break;
        }

        case _START_EXECUTOR: {
            break;
        }

        case _MAKE_WARM: {
            break;
        }

        case _FATAL_ERROR: {
            break;
        }

        case _DEOPT: {
            ctx->done = true;
            break;
        }

        case _HANDLE_PENDING_AND_DEOPT: {
            break;
        }

        case _ERROR_POP_N: {
            break;
        }

        case _SPILL_OR_RELOAD: {
            break;
        }

        case _TIER2_RESUME_CHECK: {
            break;
        }

        case _COLD_EXIT: {
            break;
        }

        case _COLD_DYNAMIC_EXIT: {
            break;
        }

        case _GUARD_CODE_VERSION__PUSH_FRAME: {
            uint32_t version = (uint32_t)this_instr->operand0;
            PyCodeObject *co = get_current_code_object(ctx);
            if (co->co_version == version) {
                _Py_BloomFilter_Add(dependencies, co);
                if (sym_get_func_version(ctx->frame->callable) == version) {
                    REPLACE_OP(this_instr, _NOP, 0, 0);
                }
            }
            else {
                ctx->done = true;
            }
            break;
        }

        case _GUARD_CODE_VERSION_YIELD_VALUE: {
            uint32_t version = (uint32_t)this_instr->operand0;
            (void)version;
            if (ctx->frame->caller) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            break;
        }

        case _GUARD_CODE_VERSION_RETURN_VALUE: {
            uint32_t version = (uint32_t)this_instr->operand0;
            (void)version;
            if (ctx->frame->caller) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            break;
        }

        case _GUARD_CODE_VERSION_RETURN_GENERATOR: {
            uint32_t version = (uint32_t)this_instr->operand0;
            (void)version;
            if (ctx->frame->caller) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            break;
        }

        case _GUARD_IP__PUSH_FRAME: {
            PyObject *ip = (PyObject *)this_instr->operand0;
            (void)ip;
            stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer);
            if (sym_get_func_version(ctx->frame->callable) != 0 &&
                // We can remove this guard for simple function call targets.
                (((PyCodeObject *)ctx->frame->func->func_code)->co_flags &
                    (CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR)) == 0) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            break;
        }

        case _GUARD_IP_YIELD_VALUE: {
            PyObject *ip = (PyObject *)this_instr->operand0;
            (void)ip;
            if (ctx->frame->caller) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer);
            break;
        }

        case _GUARD_IP_RETURN_VALUE: {
            PyObject *ip = (PyObject *)this_instr->operand0;
            (void)ip;
            if (ctx->frame->caller) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer);
            break;
        }

        case _GUARD_IP_RETURN_GENERATOR: {
            PyObject *ip = (PyObject *)this_instr->operand0;
            (void)ip;
            if (ctx->frame->caller) {
                REPLACE_OP(this_instr, _NOP, 0, 0);
            }
            stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer);
            break;
        }

        case _RECORD_TOS: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            sym_set_recorded_value(tos, (PyObject *)this_instr->operand0);
            break;
        }

        case _RECORD_TOS_TYPE: {
            JitOptRef tos;
            tos = stack_pointer[-1];
            PyTypeObject *tp = (PyTypeObject *)this_instr->operand0;
            sym_set_recorded_type(tos, tp);
            break;
        }

        case _RECORD_NOS: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            sym_set_recorded_value(nos, (PyObject *)this_instr->operand0);
            break;
        }

        case _RECORD_NOS_GEN_FUNC: {
            JitOptRef nos;
            nos = stack_pointer[-2];
            PyFunctionObject *func = (PyFunctionObject *)this_instr->operand0;
            assert(func == NULL || PyFunction_Check(func));
            sym_set_recorded_gen_func(nos, func);
            break;
        }

        case _RECORD_3OS_GEN_FUNC: {
            JitOptRef gen;
            gen = stack_pointer[-3];
            PyFunctionObject *func = (PyFunctionObject *)this_instr->operand0;
            assert(func == NULL || PyFunction_Check(func));
            sym_set_recorded_gen_func(gen, func);
            break;
        }

        case _RECORD_4OS: {
            JitOptRef value;
            value = stack_pointer[-4];
            sym_set_recorded_value(value, (PyObject *)this_instr->operand0);
            break;
        }

        case _RECORD_CALLABLE: {
            JitOptRef func;
            func = stack_pointer[-2 - oparg];
            sym_set_recorded_value(func, (PyObject *)this_instr->operand0);
            break;
        }

        case _RECORD_BOUND_METHOD: {
            break;
        }

        case _RECORD_CODE: {
            break;
        }

        /* _TRACE_RECORD is not a viable micro-op for tier 2 */

