7#include "nuitka/prelude.h"
13static inline bool _INPLACE_OPERATION_BITAND_LONG_LONG(PyObject **operand1, PyObject *operand2) {
16 CHECK_OBJECT(*operand1);
17 assert(PyLong_CheckExact(*operand1));
18 CHECK_OBJECT(operand2);
19 assert(PyLong_CheckExact(operand2));
24#pragma warning(disable : 4101)
26 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
27 NUITKA_MAY_BE_UNUSED
long clong_result;
32 PyObject *x = PyLong_Type.tp_as_number->nb_and(*operand1, operand2);
33 assert(x != Py_NotImplemented);
36 goto exit_result_object;
39 if (unlikely(obj_result == NULL)) {
40 goto exit_result_exception;
44 *operand1 = obj_result;
54bool INPLACE_OPERATION_BITAND_LONG_LONG(PyObject **operand1, PyObject *operand2) {
55 return _INPLACE_OPERATION_BITAND_LONG_LONG(operand1, operand2);
59static HEDLEY_NEVER_INLINE
bool __INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {
60 PyTypeObject *type1 = Py_TYPE(*operand1);
64#pragma warning(disable : 4101)
66 NUITKA_MAY_BE_UNUSED
bool cbool_result;
67 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
73 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;
76 PyObject *x = islot(*operand1, operand2);
78 if (x != Py_NotImplemented) {
80 goto exit_inplace_result_object;
83 Py_DECREF_IMMORTAL(x);
88 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
89 binaryfunc slot2 = NULL;
91 if (!(type1 == &PyLong_Type)) {
94 slot2 = PyLong_Type.tp_as_number->nb_and;
102 PyObject *x = slot1(*operand1, operand2);
104 if (x != Py_NotImplemented) {
106 goto exit_inplace_result_object;
109 Py_DECREF_IMMORTAL(x);
113 PyObject *x = slot2(*operand1, operand2);
115 if (x != Py_NotImplemented) {
117 goto exit_inplace_result_object;
120 Py_DECREF_IMMORTAL(x);
123#if PYTHON_VERSION < 0x300
124 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
126 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
129 PyObject *coerced1 = *operand1;
130 PyObject *coerced2 = operand2;
132 int err = c1(&coerced1, &coerced2);
134 if (unlikely(err < 0)) {
135 goto exit_inplace_exception;
139 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
141 if (likely(mv == NULL)) {
142 binaryfunc slot = mv->nb_and;
144 if (likely(slot != NULL)) {
145 PyObject *x = slot(coerced1, coerced2);
151 goto exit_inplace_result_object;
160 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
163 PyObject *coerced1 = *operand1;
164 PyObject *coerced2 = operand2;
166 int err = c2(&coerced2, &coerced1);
168 if (unlikely(err < 0)) {
169 goto exit_inplace_exception;
173 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
175 if (likely(mv == NULL)) {
176 binaryfunc slot = mv->nb_and;
178 if (likely(slot != NULL)) {
179 PyObject *x = slot(coerced1, coerced2);
185 goto exit_inplace_result_object;
197#if PYTHON_VERSION < 0x300
198 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: '%s' and 'long'", type1->tp_name);
200 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: '%s' and 'int'", type1->tp_name);
202 goto exit_inplace_exception;
205exit_inplace_result_object:
206 if (unlikely(obj_result == NULL)) {
211 Py_DECREF(*operand1);
215 *operand1 = obj_result;
219exit_inplace_exception:
222static inline bool _INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {
225 CHECK_OBJECT(*operand1);
226 CHECK_OBJECT(operand2);
227 assert(PyLong_CheckExact(operand2));
229 PyTypeObject *type1 = Py_TYPE(*operand1);
231 if (type1 == &PyLong_Type) {
237#pragma warning(disable : 4101)
239 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
240 NUITKA_MAY_BE_UNUSED
long clong_result;
245 PyObject *x = PyLong_Type.tp_as_number->nb_and(*operand1, operand2);
246 assert(x != Py_NotImplemented);
249 goto exit_result_object;
252 if (unlikely(obj_result == NULL)) {
253 goto exit_result_exception;
256 Py_DECREF(*operand1);
257 *operand1 = obj_result;
263 exit_result_exception:
267 return __INPLACE_OPERATION_BITAND_OBJECT_LONG(operand1, operand2);
270bool INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject **operand1, PyObject *operand2) {
271 return _INPLACE_OPERATION_BITAND_OBJECT_LONG(operand1, operand2);
275static HEDLEY_NEVER_INLINE
bool __INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {
276 PyTypeObject *type2 = Py_TYPE(operand2);
280#pragma warning(disable : 4101)
282 NUITKA_MAY_BE_UNUSED
bool cbool_result;
283 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
291 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;
292 binaryfunc slot2 = NULL;
294 if (!(&PyLong_Type == type2)) {
297 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
299 if (slot1 == slot2) {
306 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
307 PyObject *x = slot2(*operand1, operand2);
309 if (x != Py_NotImplemented) {
311 goto exit_inplace_result_object;
314 Py_DECREF_IMMORTAL(x);
319 PyObject *x = slot1(*operand1, operand2);
321 if (x != Py_NotImplemented) {
323 goto exit_inplace_result_object;
326 Py_DECREF_IMMORTAL(x);
330 PyObject *x = slot2(*operand1, operand2);
332 if (x != Py_NotImplemented) {
334 goto exit_inplace_result_object;
337 Py_DECREF_IMMORTAL(x);
340#if PYTHON_VERSION < 0x300
341 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
342 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
345 PyObject *coerced1 = *operand1;
346 PyObject *coerced2 = operand2;
348 int err = c1(&coerced1, &coerced2);
350 if (unlikely(err < 0)) {
351 goto exit_inplace_exception;
355 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
357 if (likely(mv == NULL)) {
358 binaryfunc slot = mv->nb_and;
360 if (likely(slot != NULL)) {
361 PyObject *x = slot(coerced1, coerced2);
367 goto exit_inplace_result_object;
377 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
380 PyObject *coerced1 = *operand1;
381 PyObject *coerced2 = operand2;
383 int err = c2(&coerced2, &coerced1);
385 if (unlikely(err < 0)) {
386 goto exit_inplace_exception;
390 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
392 if (likely(mv == NULL)) {
393 binaryfunc slot = mv->nb_and;
395 if (likely(slot != NULL)) {
396 PyObject *x = slot(coerced1, coerced2);
402 goto exit_inplace_result_object;
414#if PYTHON_VERSION < 0x300
415 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: 'long' and '%s'", type2->tp_name);
417 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: 'int' and '%s'", type2->tp_name);
419 goto exit_inplace_exception;
422exit_inplace_result_object:
423 if (unlikely(obj_result == NULL)) {
428 Py_DECREF(*operand1);
432 *operand1 = obj_result;
436exit_inplace_exception:
439static inline bool _INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {
442 CHECK_OBJECT(*operand1);
443 assert(PyLong_CheckExact(*operand1));
444 CHECK_OBJECT(operand2);
446 PyTypeObject *type2 = Py_TYPE(operand2);
448 if (&PyLong_Type == type2) {
454#pragma warning(disable : 4101)
456 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
457 NUITKA_MAY_BE_UNUSED
long clong_result;
462 PyObject *x = PyLong_Type.tp_as_number->nb_and(*operand1, operand2);
463 assert(x != Py_NotImplemented);
466 goto exit_result_object;
469 if (unlikely(obj_result == NULL)) {
470 goto exit_result_exception;
473 Py_DECREF(*operand1);
474 *operand1 = obj_result;
480 exit_result_exception:
484 return __INPLACE_OPERATION_BITAND_LONG_OBJECT(operand1, operand2);
487bool INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject **operand1, PyObject *operand2) {
488 return _INPLACE_OPERATION_BITAND_LONG_OBJECT(operand1, operand2);
491#if PYTHON_VERSION < 0x300
493static inline bool _INPLACE_OPERATION_BITAND_INT_INT(PyObject **operand1, PyObject *operand2) {
496 CHECK_OBJECT(*operand1);
497 assert(PyInt_CheckExact(*operand1));
498 CHECK_OBJECT(operand2);
499 assert(PyInt_CheckExact(operand2));
504#pragma warning(disable : 4101)
506 NUITKA_MAY_BE_UNUSED
bool cbool_result;
507 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
508 NUITKA_MAY_BE_UNUSED
long clong_result;
509 NUITKA_MAY_BE_UNUSED
double cfloat_result;
514 CHECK_OBJECT(*operand1);
515 assert(PyInt_CheckExact(*operand1));
516 CHECK_OBJECT(operand2);
517 assert(PyInt_CheckExact(operand2));
519 const long a = PyInt_AS_LONG(*operand1);
520 const long b = PyInt_AS_LONG(operand2);
522 const long r = a & b;
525 goto exit_result_ok_clong;
530 Py_DECREF(*operand1);
534 *operand1 = Nuitka_PyInt_FromLong(clong_result);
541bool INPLACE_OPERATION_BITAND_INT_INT(PyObject **operand1, PyObject *operand2) {
542 return _INPLACE_OPERATION_BITAND_INT_INT(operand1, operand2);
546#if PYTHON_VERSION < 0x300
548static HEDLEY_NEVER_INLINE
bool __INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2) {
549 PyTypeObject *type1 = Py_TYPE(*operand1);
553#pragma warning(disable : 4101)
555 NUITKA_MAY_BE_UNUSED
bool cbool_result;
556 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
562 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;
565 PyObject *x = islot(*operand1, operand2);
567 if (x != Py_NotImplemented) {
569 goto exit_inplace_result_object;
572 Py_DECREF_IMMORTAL(x);
577 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
578 binaryfunc slot2 = NULL;
580 if (!(type1 == &PyInt_Type)) {
583 slot2 = PyInt_Type.tp_as_number->nb_and;
585 if (slot1 == slot2) {
591 PyObject *x = slot1(*operand1, operand2);
593 if (x != Py_NotImplemented) {
595 goto exit_inplace_result_object;
598 Py_DECREF_IMMORTAL(x);
602 PyObject *x = slot2(*operand1, operand2);
604 if (x != Py_NotImplemented) {
606 goto exit_inplace_result_object;
609 Py_DECREF_IMMORTAL(x);
612#if PYTHON_VERSION < 0x300
613 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
615 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
618 PyObject *coerced1 = *operand1;
619 PyObject *coerced2 = operand2;
621 int err = c1(&coerced1, &coerced2);
623 if (unlikely(err < 0)) {
624 goto exit_inplace_exception;
628 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
630 if (likely(mv == NULL)) {
631 binaryfunc slot = mv->nb_and;
633 if (likely(slot != NULL)) {
634 PyObject *x = slot(coerced1, coerced2);
640 goto exit_inplace_result_object;
649 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
652 PyObject *coerced1 = *operand1;
653 PyObject *coerced2 = operand2;
655 int err = c2(&coerced2, &coerced1);
657 if (unlikely(err < 0)) {
658 goto exit_inplace_exception;
662 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
664 if (likely(mv == NULL)) {
665 binaryfunc slot = mv->nb_and;
667 if (likely(slot != NULL)) {
668 PyObject *x = slot(coerced1, coerced2);
674 goto exit_inplace_result_object;
686 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: '%s' and 'int'", type1->tp_name);
687 goto exit_inplace_exception;
690exit_inplace_result_object:
691 if (unlikely(obj_result == NULL)) {
696 Py_DECREF(*operand1);
700 *operand1 = obj_result;
704exit_inplace_exception:
707static inline bool _INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2) {
710 CHECK_OBJECT(*operand1);
711 CHECK_OBJECT(operand2);
712 assert(PyInt_CheckExact(operand2));
714 PyTypeObject *type1 = Py_TYPE(*operand1);
716 if (type1 == &PyInt_Type) {
722#pragma warning(disable : 4101)
724 NUITKA_MAY_BE_UNUSED
bool cbool_result;
725 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
726 NUITKA_MAY_BE_UNUSED
long clong_result;
727 NUITKA_MAY_BE_UNUSED
double cfloat_result;
732 CHECK_OBJECT(*operand1);
733 assert(PyInt_CheckExact(*operand1));
734 CHECK_OBJECT(operand2);
735 assert(PyInt_CheckExact(operand2));
737 const long a = PyInt_AS_LONG(*operand1);
738 const long b = PyInt_AS_LONG(operand2);
740 const long r = a & b;
743 goto exit_result_ok_clong;
745 exit_result_ok_clong:
748 Py_DECREF(*operand1);
752 *operand1 = Nuitka_PyInt_FromLong(clong_result);
759 return __INPLACE_OPERATION_BITAND_OBJECT_INT(operand1, operand2);
762bool INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyObject *operand2) {
763 return _INPLACE_OPERATION_BITAND_OBJECT_INT(operand1, operand2);
767#if PYTHON_VERSION < 0x300
769static HEDLEY_NEVER_INLINE
bool __INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2) {
770 PyTypeObject *type2 = Py_TYPE(operand2);
774#pragma warning(disable : 4101)
776 NUITKA_MAY_BE_UNUSED
bool cbool_result;
777 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
785 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_and;
786 binaryfunc slot2 = NULL;
788 if (!(&PyInt_Type == type2)) {
791 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
793 if (slot1 == slot2) {
800 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
801 PyObject *x = slot2(*operand1, operand2);
803 if (x != Py_NotImplemented) {
805 goto exit_inplace_result_object;
808 Py_DECREF_IMMORTAL(x);
813 PyObject *x = slot1(*operand1, operand2);
815 if (x != Py_NotImplemented) {
817 goto exit_inplace_result_object;
820 Py_DECREF_IMMORTAL(x);
824 PyObject *x = slot2(*operand1, operand2);
826 if (x != Py_NotImplemented) {
828 goto exit_inplace_result_object;
831 Py_DECREF_IMMORTAL(x);
834#if PYTHON_VERSION < 0x300
835 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
836 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
839 PyObject *coerced1 = *operand1;
840 PyObject *coerced2 = operand2;
842 int err = c1(&coerced1, &coerced2);
844 if (unlikely(err < 0)) {
845 goto exit_inplace_exception;
849 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
851 if (likely(mv == NULL)) {
852 binaryfunc slot = mv->nb_and;
854 if (likely(slot != NULL)) {
855 PyObject *x = slot(coerced1, coerced2);
861 goto exit_inplace_result_object;
871 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
874 PyObject *coerced1 = *operand1;
875 PyObject *coerced2 = operand2;
877 int err = c2(&coerced2, &coerced1);
879 if (unlikely(err < 0)) {
880 goto exit_inplace_exception;
884 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
886 if (likely(mv == NULL)) {
887 binaryfunc slot = mv->nb_and;
889 if (likely(slot != NULL)) {
890 PyObject *x = slot(coerced1, coerced2);
896 goto exit_inplace_result_object;
908 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: 'int' and '%s'", type2->tp_name);
909 goto exit_inplace_exception;
912exit_inplace_result_object:
913 if (unlikely(obj_result == NULL)) {
918 Py_DECREF(*operand1);
922 *operand1 = obj_result;
926exit_inplace_exception:
929static inline bool _INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2) {
932 CHECK_OBJECT(*operand1);
933 assert(PyInt_CheckExact(*operand1));
934 CHECK_OBJECT(operand2);
936 PyTypeObject *type2 = Py_TYPE(operand2);
938 if (&PyInt_Type == type2) {
944#pragma warning(disable : 4101)
946 NUITKA_MAY_BE_UNUSED
bool cbool_result;
947 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
948 NUITKA_MAY_BE_UNUSED
long clong_result;
949 NUITKA_MAY_BE_UNUSED
double cfloat_result;
954 CHECK_OBJECT(*operand1);
955 assert(PyInt_CheckExact(*operand1));
956 CHECK_OBJECT(operand2);
957 assert(PyInt_CheckExact(operand2));
959 const long a = PyInt_AS_LONG(*operand1);
960 const long b = PyInt_AS_LONG(operand2);
962 const long r = a & b;
965 goto exit_result_ok_clong;
967 exit_result_ok_clong:
970 Py_DECREF(*operand1);
974 *operand1 = Nuitka_PyInt_FromLong(clong_result);
981 return __INPLACE_OPERATION_BITAND_INT_OBJECT(operand1, operand2);
984bool INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyObject *operand2) {
985 return _INPLACE_OPERATION_BITAND_INT_OBJECT(operand1, operand2);
989#if PYTHON_VERSION < 0x300
991static inline bool _INPLACE_OPERATION_BITAND_INT_CLONG(PyObject **operand1,
long operand2) {
994 CHECK_OBJECT(*operand1);
995 assert(PyInt_CheckExact(*operand1));
1000#pragma warning(disable : 4101)
1002 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1003 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1004 NUITKA_MAY_BE_UNUSED
long clong_result;
1005 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1006#if defined(_MSC_VER)
1010 CHECK_OBJECT(*operand1);
1011 assert(PyInt_CheckExact(*operand1));
1013 const long a = PyInt_AS_LONG(*operand1);
1014 const long b = operand2;
1016 const long r = a & b;
1019 goto exit_result_ok_clong;
1021exit_result_ok_clong:
1024 Py_DECREF(*operand1);
1028 *operand1 = Nuitka_PyInt_FromLong(clong_result);
1029 goto exit_result_ok;
1035bool INPLACE_OPERATION_BITAND_INT_CLONG(PyObject **operand1,
long operand2) {
1036 return _INPLACE_OPERATION_BITAND_INT_CLONG(operand1, operand2);
1040#if PYTHON_VERSION < 0x300
1042static inline bool _INPLACE_OPERATION_BITAND_LONG_INT(PyObject **operand1, PyObject *operand2) {
1045 CHECK_OBJECT(*operand1);
1046 assert(PyLong_CheckExact(*operand1));
1047 CHECK_OBJECT(operand2);
1048 assert(PyInt_CheckExact(operand2));
1050#if defined(_MSC_VER)
1051#pragma warning(push)
1052#pragma warning(disable : 4101)
1054 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1055 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1056#if defined(_MSC_VER)
1063 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;
1066 if (slot1 != NULL) {
1067 PyObject *x = slot1(*operand1, operand2);
1069 if (x != Py_NotImplemented) {
1071 goto exit_inplace_result_object;
1074 Py_DECREF_IMMORTAL(x);
1079 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: 'long' and 'int'");
1080 goto exit_inplace_exception;
1083exit_inplace_result_object:
1084 if (unlikely(obj_result == NULL)) {
1089 Py_DECREF(*operand1);
1093 *operand1 = obj_result;
1097exit_inplace_exception:
1101bool INPLACE_OPERATION_BITAND_LONG_INT(PyObject **operand1, PyObject *operand2) {
1102 return _INPLACE_OPERATION_BITAND_LONG_INT(operand1, operand2);
1106#if PYTHON_VERSION < 0x300
1108static inline bool _INPLACE_OPERATION_BITAND_INT_LONG(PyObject **operand1, PyObject *operand2) {
1111 CHECK_OBJECT(*operand1);
1112 assert(PyInt_CheckExact(*operand1));
1113 CHECK_OBJECT(operand2);
1114 assert(PyLong_CheckExact(operand2));
1116#if defined(_MSC_VER)
1117#pragma warning(push)
1118#pragma warning(disable : 4101)
1120 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1121 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1122#if defined(_MSC_VER)
1130 binaryfunc slot2 = NULL;
1135 slot2 = PyLong_Type.tp_as_number->nb_and;
1138 if (slot2 != NULL) {
1139 PyObject *x = slot2(*operand1, operand2);
1141 if (x != Py_NotImplemented) {
1143 goto exit_inplace_result_object;
1146 Py_DECREF_IMMORTAL(x);
1151 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: 'int' and 'long'");
1152 goto exit_inplace_exception;
1155exit_inplace_result_object:
1156 if (unlikely(obj_result == NULL)) {
1161 Py_DECREF(*operand1);
1165 *operand1 = obj_result;
1169exit_inplace_exception:
1173bool INPLACE_OPERATION_BITAND_INT_LONG(PyObject **operand1, PyObject *operand2) {
1174 return _INPLACE_OPERATION_BITAND_INT_LONG(operand1, operand2);
1179static inline bool _INPLACE_OPERATION_BITAND_SET_SET(PyObject **operand1, PyObject *operand2) {
1182 CHECK_OBJECT(*operand1);
1183 assert(PySet_CheckExact(*operand1));
1184 CHECK_OBJECT(operand2);
1185 assert(PySet_CheckExact(operand2));
1188 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1190 PyObject *x = PySet_Type.tp_as_number->nb_inplace_and(*operand1, operand2);
1192 assert(x != Py_NotImplemented);
1195 goto exit_result_object;
1198 if (unlikely(obj_result == NULL)) {
1199 goto exit_result_exception;
1202 Py_DECREF(*operand1);
1204 *operand1 = obj_result;
1205 goto exit_result_ok;
1210exit_result_exception:
1214bool INPLACE_OPERATION_BITAND_SET_SET(PyObject **operand1, PyObject *operand2) {
1215 return _INPLACE_OPERATION_BITAND_SET_SET(operand1, operand2);
1219static HEDLEY_NEVER_INLINE
bool __INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2) {
1220 PyTypeObject *type1 = Py_TYPE(*operand1);
1222#if defined(_MSC_VER)
1223#pragma warning(push)
1224#pragma warning(disable : 4101)
1226 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1227 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1228#if defined(_MSC_VER)
1233 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;
1235 if (islot != NULL) {
1236 PyObject *x = islot(*operand1, operand2);
1238 if (x != Py_NotImplemented) {
1240 goto exit_inplace_result_object;
1243 Py_DECREF_IMMORTAL(x);
1248 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
1249 binaryfunc slot2 = NULL;
1251 if (!(type1 == &PySet_Type)) {
1254 slot2 = PySet_Type.tp_as_number->nb_and;
1256 if (slot1 == slot2) {
1261 if (slot1 != NULL) {
1262 PyObject *x = slot1(*operand1, operand2);
1264 if (x != Py_NotImplemented) {
1266 goto exit_inplace_result_object;
1269 Py_DECREF_IMMORTAL(x);
1272 if (slot2 != NULL) {
1273 PyObject *x = slot2(*operand1, operand2);
1275 if (x != Py_NotImplemented) {
1277 goto exit_inplace_result_object;
1280 Py_DECREF_IMMORTAL(x);
1283#if PYTHON_VERSION < 0x300
1284 if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {
1286 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1289 PyObject *coerced1 = *operand1;
1290 PyObject *coerced2 = operand2;
1292 int err = c1(&coerced1, &coerced2);
1294 if (unlikely(err < 0)) {
1295 goto exit_inplace_exception;
1299 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1301 if (likely(mv == NULL)) {
1302 binaryfunc slot = mv->nb_and;
1304 if (likely(slot != NULL)) {
1305 PyObject *x = slot(coerced1, coerced2);
1307 Py_DECREF(coerced1);
1308 Py_DECREF(coerced2);
1311 goto exit_inplace_result_object;
1316 Py_DECREF(coerced1);
1317 Py_DECREF(coerced2);
1323 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: '%s' and 'set'", type1->tp_name);
1324 goto exit_inplace_exception;
1327exit_inplace_result_object:
1328 if (unlikely(obj_result == NULL)) {
1333 Py_DECREF(*operand1);
1337 *operand1 = obj_result;
1341exit_inplace_exception:
1344static inline bool _INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2) {
1347 CHECK_OBJECT(*operand1);
1348 CHECK_OBJECT(operand2);
1349 assert(PySet_CheckExact(operand2));
1351 PyTypeObject *type1 = Py_TYPE(*operand1);
1353 if (type1 == &PySet_Type) {
1357 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1359 PyObject *x = PySet_Type.tp_as_number->nb_inplace_and(*operand1, operand2);
1361 assert(x != Py_NotImplemented);
1364 goto exit_result_object;
1367 if (unlikely(obj_result == NULL)) {
1368 goto exit_result_exception;
1371 Py_DECREF(*operand1);
1373 *operand1 = obj_result;
1374 goto exit_result_ok;
1379 exit_result_exception:
1383 return __INPLACE_OPERATION_BITAND_OBJECT_SET(operand1, operand2);
1386bool INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject **operand1, PyObject *operand2) {
1387 return _INPLACE_OPERATION_BITAND_OBJECT_SET(operand1, operand2);
1391static HEDLEY_NEVER_INLINE
bool __INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2) {
1392 PyTypeObject *type2 = Py_TYPE(operand2);
1394#if defined(_MSC_VER)
1395#pragma warning(push)
1396#pragma warning(disable : 4101)
1398 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1399 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1400#if defined(_MSC_VER)
1404 binaryfunc islot = PySet_Type.tp_as_number->nb_inplace_and;
1406 if (islot != NULL) {
1407 PyObject *x = islot(*operand1, operand2);
1409 if (x != Py_NotImplemented) {
1411 goto exit_inplace_result_object;
1414 Py_DECREF_IMMORTAL(x);
1418 binaryfunc slot1 = PySet_Type.tp_as_number->nb_and;
1419 binaryfunc slot2 = NULL;
1421 if (!(&PySet_Type == type2)) {
1424 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
1426 if (slot1 == slot2) {
1431 if (slot1 != NULL) {
1432 if (slot2 != NULL) {
1433 if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {
1434 PyObject *x = slot2(*operand1, operand2);
1436 if (x != Py_NotImplemented) {
1438 goto exit_inplace_result_object;
1441 Py_DECREF_IMMORTAL(x);
1446 PyObject *x = slot1(*operand1, operand2);
1448 if (x != Py_NotImplemented) {
1450 goto exit_inplace_result_object;
1453 Py_DECREF_IMMORTAL(x);
1456 if (slot2 != NULL) {
1457 PyObject *x = slot2(*operand1, operand2);
1459 if (x != Py_NotImplemented) {
1461 goto exit_inplace_result_object;
1464 Py_DECREF_IMMORTAL(x);
1467#if PYTHON_VERSION < 0x300
1468 if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1470 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1473 PyObject *coerced1 = *operand1;
1474 PyObject *coerced2 = operand2;
1476 int err = c2(&coerced2, &coerced1);
1478 if (unlikely(err < 0)) {
1479 goto exit_inplace_exception;
1483 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1485 if (likely(mv == NULL)) {
1486 binaryfunc slot = mv->nb_and;
1488 if (likely(slot != NULL)) {
1489 PyObject *x = slot(coerced1, coerced2);
1491 Py_DECREF(coerced1);
1492 Py_DECREF(coerced2);
1495 goto exit_inplace_result_object;
1500 Py_DECREF(coerced1);
1501 Py_DECREF(coerced2);
1507 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: 'set' and '%s'", type2->tp_name);
1508 goto exit_inplace_exception;
1511exit_inplace_result_object:
1512 if (unlikely(obj_result == NULL)) {
1517 Py_DECREF(*operand1);
1521 *operand1 = obj_result;
1525exit_inplace_exception:
1528static inline bool _INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2) {
1531 CHECK_OBJECT(*operand1);
1532 assert(PySet_CheckExact(*operand1));
1533 CHECK_OBJECT(operand2);
1535 PyTypeObject *type2 = Py_TYPE(operand2);
1537 if (&PySet_Type == type2) {
1541 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1543 PyObject *x = PySet_Type.tp_as_number->nb_inplace_and(*operand1, operand2);
1545 assert(x != Py_NotImplemented);
1548 goto exit_result_object;
1551 if (unlikely(obj_result == NULL)) {
1552 goto exit_result_exception;
1555 Py_DECREF(*operand1);
1557 *operand1 = obj_result;
1558 goto exit_result_ok;
1563 exit_result_exception:
1567 return __INPLACE_OPERATION_BITAND_SET_OBJECT(operand1, operand2);
1570bool INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject **operand1, PyObject *operand2) {
1571 return _INPLACE_OPERATION_BITAND_SET_OBJECT(operand1, operand2);
1575static inline bool _INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {
1578 CHECK_OBJECT(*operand1);
1579 CHECK_OBJECT(operand2);
1581#if PYTHON_VERSION < 0x300
1582 if (PyInt_CheckExact(*operand1) && PyInt_CheckExact(operand2)) {
1585#if defined(_MSC_VER)
1586#pragma warning(push)
1587#pragma warning(disable : 4101)
1589 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1590 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1591 NUITKA_MAY_BE_UNUSED
long clong_result;
1592 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1593#if defined(_MSC_VER)
1597 CHECK_OBJECT(*operand1);
1598 assert(PyInt_CheckExact(*operand1));
1599 CHECK_OBJECT(operand2);
1600 assert(PyInt_CheckExact(operand2));
1602 const long a = PyInt_AS_LONG(*operand1);
1603 const long b = PyInt_AS_LONG(operand2);
1605 const long r = a & b;
1608 goto exit_result_ok_clong;
1610 exit_result_ok_clong:
1613 Py_DECREF(*operand1);
1617 *operand1 = Nuitka_PyInt_FromLong(clong_result);
1618 goto exit_result_ok;
1625 if (Py_TYPE(*operand1) == Py_TYPE(operand2)) {
1626#if PYTHON_VERSION >= 0x300
1627 if (PyLong_CheckExact(operand2)) {
1628 return _INPLACE_OPERATION_BITAND_LONG_LONG(operand1, operand2);
1633 PyTypeObject *type1 = Py_TYPE(*operand1);
1634 PyTypeObject *type2 = Py_TYPE(operand2);
1636#if defined(_MSC_VER)
1637#pragma warning(push)
1638#pragma warning(disable : 4101)
1640 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1641 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1642#if defined(_MSC_VER)
1647 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_inplace_and : NULL;
1649 if (islot != NULL) {
1650 PyObject *x = islot(*operand1, operand2);
1652 if (x != Py_NotImplemented) {
1654 goto exit_inplace_result_object;
1657 Py_DECREF_IMMORTAL(x);
1662 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
1663 binaryfunc slot2 = NULL;
1665 if (!(type1 == type2)) {
1668 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
1670 if (slot1 == slot2) {
1675 if (slot1 != NULL) {
1676 if (slot2 != NULL) {
1677 if (Nuitka_Type_IsSubtype(type2, type1)) {
1678 PyObject *x = slot2(*operand1, operand2);
1680 if (x != Py_NotImplemented) {
1682 goto exit_inplace_result_object;
1685 Py_DECREF_IMMORTAL(x);
1690 PyObject *x = slot1(*operand1, operand2);
1692 if (x != Py_NotImplemented) {
1694 goto exit_inplace_result_object;
1697 Py_DECREF_IMMORTAL(x);
1700 if (slot2 != NULL) {
1701 PyObject *x = slot2(*operand1, operand2);
1703 if (x != Py_NotImplemented) {
1705 goto exit_inplace_result_object;
1708 Py_DECREF_IMMORTAL(x);
1711#if PYTHON_VERSION < 0x300
1712 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
1714 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1717 PyObject *coerced1 = *operand1;
1718 PyObject *coerced2 = operand2;
1720 int err = c1(&coerced1, &coerced2);
1722 if (unlikely(err < 0)) {
1723 goto exit_inplace_exception;
1727 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1729 if (likely(mv == NULL)) {
1730 binaryfunc slot = mv->nb_and;
1732 if (likely(slot != NULL)) {
1733 PyObject *x = slot(coerced1, coerced2);
1735 Py_DECREF(coerced1);
1736 Py_DECREF(coerced2);
1739 goto exit_inplace_result_object;
1744 Py_DECREF(coerced1);
1745 Py_DECREF(coerced2);
1749 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1752 PyObject *coerced1 = *operand1;
1753 PyObject *coerced2 = operand2;
1755 int err = c2(&coerced2, &coerced1);
1757 if (unlikely(err < 0)) {
1758 goto exit_inplace_exception;
1762 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1764 if (likely(mv == NULL)) {
1765 binaryfunc slot = mv->nb_and;
1767 if (likely(slot != NULL)) {
1768 PyObject *x = slot(coerced1, coerced2);
1770 Py_DECREF(coerced1);
1771 Py_DECREF(coerced2);
1774 goto exit_inplace_result_object;
1779 Py_DECREF(coerced1);
1780 Py_DECREF(coerced2);
1786 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &=: '%s' and '%s'", type1->tp_name,
1788 goto exit_inplace_exception;
1791exit_inplace_result_object:
1792 if (unlikely(obj_result == NULL)) {
1797 Py_DECREF(*operand1);
1801 *operand1 = obj_result;
1805exit_inplace_exception:
1809bool INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1, PyObject *operand2) {
1810 return _INPLACE_OPERATION_BITAND_OBJECT_OBJECT(operand1, operand2);