7#include "nuitka/prelude.h"
13static PyObject *_BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
14 CHECK_OBJECT(operand1);
15 assert(PyLong_CheckExact(operand1));
16 CHECK_OBJECT(operand2);
17 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;
52PyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
53 return _BINARY_OPERATION_BITAND_OBJECT_LONG_LONG(operand1, operand2);
57static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1,
59 PyTypeObject *type1 = Py_TYPE(operand1);
63#pragma warning(disable : 4101)
65 NUITKA_MAY_BE_UNUSED
bool cbool_result;
66 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
72 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
73 binaryfunc slot2 = NULL;
75 if (!(type1 == &PyLong_Type)) {
78 slot2 = PyLong_Type.tp_as_number->nb_and;
86 PyObject *x = slot1(operand1, operand2);
88 if (x != Py_NotImplemented) {
90 goto exit_binary_result_object;
93 Py_DECREF_IMMORTAL(x);
97 PyObject *x = slot2(operand1, operand2);
99 if (x != Py_NotImplemented) {
101 goto exit_binary_result_object;
104 Py_DECREF_IMMORTAL(x);
107#if PYTHON_VERSION < 0x300
108 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
110 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
113 PyObject *coerced1 = operand1;
114 PyObject *coerced2 = operand2;
116 int err = c1(&coerced1, &coerced2);
118 if (unlikely(err < 0)) {
119 goto exit_binary_exception;
123 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
125 if (likely(mv == NULL)) {
126 binaryfunc slot = mv->nb_and;
128 if (likely(slot != NULL)) {
129 PyObject *x = slot(coerced1, coerced2);
135 goto exit_binary_result_object;
144 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
147 PyObject *coerced1 = operand1;
148 PyObject *coerced2 = operand2;
150 int err = c2(&coerced2, &coerced1);
152 if (unlikely(err < 0)) {
153 goto exit_binary_exception;
157 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
159 if (likely(mv == NULL)) {
160 binaryfunc slot = mv->nb_and;
162 if (likely(slot != NULL)) {
163 PyObject *x = slot(coerced1, coerced2);
169 goto exit_binary_result_object;
181#if PYTHON_VERSION < 0x300
182 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'long'", type1->tp_name);
184 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'int'", type1->tp_name);
186 goto exit_binary_exception;
188exit_binary_result_object:
191exit_binary_exception:
194static PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
195 CHECK_OBJECT(operand1);
196 CHECK_OBJECT(operand2);
197 assert(PyLong_CheckExact(operand2));
199 PyTypeObject *type1 = Py_TYPE(operand1);
201 if (type1 == &PyLong_Type) {
209#pragma warning(disable : 4101)
211 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
212 NUITKA_MAY_BE_UNUSED
long clong_result;
217 PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);
218 assert(x != Py_NotImplemented);
221 goto exit_result_object;
224 if (unlikely(obj_result == NULL)) {
225 goto exit_result_exception;
233 exit_result_exception:
237 return __BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(operand1, operand2);
240PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
241 return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_LONG(operand1, operand2);
245static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1,
246 PyObject *operand2) {
247 PyTypeObject *type2 = Py_TYPE(operand2);
251#pragma warning(disable : 4101)
253 NUITKA_MAY_BE_UNUSED
bool cbool_result;
254 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
259 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;
260 binaryfunc slot2 = NULL;
262 if (!(&PyLong_Type == type2)) {
265 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
267 if (slot1 == slot2) {
274 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
275 PyObject *x = slot2(operand1, operand2);
277 if (x != Py_NotImplemented) {
279 goto exit_binary_result_object;
282 Py_DECREF_IMMORTAL(x);
287 PyObject *x = slot1(operand1, operand2);
289 if (x != Py_NotImplemented) {
291 goto exit_binary_result_object;
294 Py_DECREF_IMMORTAL(x);
298 PyObject *x = slot2(operand1, operand2);
300 if (x != Py_NotImplemented) {
302 goto exit_binary_result_object;
305 Py_DECREF_IMMORTAL(x);
308#if PYTHON_VERSION < 0x300
309 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
310 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
313 PyObject *coerced1 = operand1;
314 PyObject *coerced2 = operand2;
316 int err = c1(&coerced1, &coerced2);
318 if (unlikely(err < 0)) {
319 goto exit_binary_exception;
323 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
325 if (likely(mv == NULL)) {
326 binaryfunc slot = mv->nb_and;
328 if (likely(slot != NULL)) {
329 PyObject *x = slot(coerced1, coerced2);
335 goto exit_binary_result_object;
345 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
348 PyObject *coerced1 = operand1;
349 PyObject *coerced2 = operand2;
351 int err = c2(&coerced2, &coerced1);
353 if (unlikely(err < 0)) {
354 goto exit_binary_exception;
358 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
360 if (likely(mv == NULL)) {
361 binaryfunc slot = mv->nb_and;
363 if (likely(slot != NULL)) {
364 PyObject *x = slot(coerced1, coerced2);
370 goto exit_binary_result_object;
382#if PYTHON_VERSION < 0x300
383 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'long' and '%s'", type2->tp_name);
385 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'int' and '%s'", type2->tp_name);
387 goto exit_binary_exception;
389exit_binary_result_object:
392exit_binary_exception:
395static PyObject *_BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
396 CHECK_OBJECT(operand1);
397 assert(PyLong_CheckExact(operand1));
398 CHECK_OBJECT(operand2);
400 PyTypeObject *type2 = Py_TYPE(operand2);
402 if (&PyLong_Type == type2) {
410#pragma warning(disable : 4101)
412 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
413 NUITKA_MAY_BE_UNUSED
long clong_result;
418 PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);
419 assert(x != Py_NotImplemented);
422 goto exit_result_object;
425 if (unlikely(obj_result == NULL)) {
426 goto exit_result_exception;
434 exit_result_exception:
438 return __BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(operand1, operand2);
441PyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
442 return _BINARY_OPERATION_BITAND_OBJECT_LONG_OBJECT(operand1, operand2);
446static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
447 CHECK_OBJECT(operand1);
448 assert(PyLong_CheckExact(operand1));
449 CHECK_OBJECT(operand2);
450 assert(PyLong_CheckExact(operand2));
457#pragma warning(disable : 4101)
459 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
460 NUITKA_MAY_BE_UNUSED
long clong_result;
465 PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);
466 assert(x != Py_NotImplemented);
469 goto exit_result_object;
472 if (unlikely(obj_result == NULL)) {
473 goto exit_result_exception;
475 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
476 Py_DECREF(obj_result);
482exit_result_exception:
483 return NUITKA_BOOL_EXCEPTION;
486nuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
487 return _BINARY_OPERATION_BITAND_NBOOL_LONG_LONG(operand1, operand2);
491static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1,
492 PyObject *operand2) {
493 PyTypeObject *type1 = Py_TYPE(operand1);
497#pragma warning(disable : 4101)
499 NUITKA_MAY_BE_UNUSED
bool cbool_result;
500 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
506 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
507 binaryfunc slot2 = NULL;
509 if (!(type1 == &PyLong_Type)) {
512 slot2 = PyLong_Type.tp_as_number->nb_and;
514 if (slot1 == slot2) {
520 PyObject *x = slot1(operand1, operand2);
522 if (x != Py_NotImplemented) {
524 goto exit_binary_result_object;
527 Py_DECREF_IMMORTAL(x);
531 PyObject *x = slot2(operand1, operand2);
533 if (x != Py_NotImplemented) {
535 goto exit_binary_result_object;
538 Py_DECREF_IMMORTAL(x);
541#if PYTHON_VERSION < 0x300
542 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
544 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
547 PyObject *coerced1 = operand1;
548 PyObject *coerced2 = operand2;
550 int err = c1(&coerced1, &coerced2);
552 if (unlikely(err < 0)) {
553 goto exit_binary_exception;
557 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
559 if (likely(mv == NULL)) {
560 binaryfunc slot = mv->nb_and;
562 if (likely(slot != NULL)) {
563 PyObject *x = slot(coerced1, coerced2);
569 goto exit_binary_result_object;
578 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
581 PyObject *coerced1 = operand1;
582 PyObject *coerced2 = operand2;
584 int err = c2(&coerced2, &coerced1);
586 if (unlikely(err < 0)) {
587 goto exit_binary_exception;
591 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
593 if (likely(mv == NULL)) {
594 binaryfunc slot = mv->nb_and;
596 if (likely(slot != NULL)) {
597 PyObject *x = slot(coerced1, coerced2);
603 goto exit_binary_result_object;
615#if PYTHON_VERSION < 0x300
616 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'long'", type1->tp_name);
618 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'int'", type1->tp_name);
620 goto exit_binary_exception;
622exit_binary_result_object:
623 if (unlikely(obj_result == NULL)) {
624 return NUITKA_BOOL_EXCEPTION;
628 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
629 Py_DECREF(obj_result);
633exit_binary_exception:
634 return NUITKA_BOOL_EXCEPTION;
636static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
637 CHECK_OBJECT(operand1);
638 CHECK_OBJECT(operand2);
639 assert(PyLong_CheckExact(operand2));
641 PyTypeObject *type1 = Py_TYPE(operand1);
643 if (type1 == &PyLong_Type) {
651#pragma warning(disable : 4101)
653 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
654 NUITKA_MAY_BE_UNUSED
long clong_result;
659 PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);
660 assert(x != Py_NotImplemented);
663 goto exit_result_object;
666 if (unlikely(obj_result == NULL)) {
667 goto exit_result_exception;
669 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
670 Py_DECREF(obj_result);
676 exit_result_exception:
677 return NUITKA_BOOL_EXCEPTION;
680 return __BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(operand1, operand2);
683nuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
684 return _BINARY_OPERATION_BITAND_NBOOL_OBJECT_LONG(operand1, operand2);
688static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1,
689 PyObject *operand2) {
690 PyTypeObject *type2 = Py_TYPE(operand2);
694#pragma warning(disable : 4101)
696 NUITKA_MAY_BE_UNUSED
bool cbool_result;
697 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
702 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;
703 binaryfunc slot2 = NULL;
705 if (!(&PyLong_Type == type2)) {
708 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
710 if (slot1 == slot2) {
717 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
718 PyObject *x = slot2(operand1, operand2);
720 if (x != Py_NotImplemented) {
722 goto exit_binary_result_object;
725 Py_DECREF_IMMORTAL(x);
730 PyObject *x = slot1(operand1, operand2);
732 if (x != Py_NotImplemented) {
734 goto exit_binary_result_object;
737 Py_DECREF_IMMORTAL(x);
741 PyObject *x = slot2(operand1, operand2);
743 if (x != Py_NotImplemented) {
745 goto exit_binary_result_object;
748 Py_DECREF_IMMORTAL(x);
751#if PYTHON_VERSION < 0x300
752 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
753 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
756 PyObject *coerced1 = operand1;
757 PyObject *coerced2 = operand2;
759 int err = c1(&coerced1, &coerced2);
761 if (unlikely(err < 0)) {
762 goto exit_binary_exception;
766 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
768 if (likely(mv == NULL)) {
769 binaryfunc slot = mv->nb_and;
771 if (likely(slot != NULL)) {
772 PyObject *x = slot(coerced1, coerced2);
778 goto exit_binary_result_object;
788 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
791 PyObject *coerced1 = operand1;
792 PyObject *coerced2 = operand2;
794 int err = c2(&coerced2, &coerced1);
796 if (unlikely(err < 0)) {
797 goto exit_binary_exception;
801 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
803 if (likely(mv == NULL)) {
804 binaryfunc slot = mv->nb_and;
806 if (likely(slot != NULL)) {
807 PyObject *x = slot(coerced1, coerced2);
813 goto exit_binary_result_object;
825#if PYTHON_VERSION < 0x300
826 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'long' and '%s'", type2->tp_name);
828 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'int' and '%s'", type2->tp_name);
830 goto exit_binary_exception;
832exit_binary_result_object:
833 if (unlikely(obj_result == NULL)) {
834 return NUITKA_BOOL_EXCEPTION;
838 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
839 Py_DECREF(obj_result);
843exit_binary_exception:
844 return NUITKA_BOOL_EXCEPTION;
846static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
847 CHECK_OBJECT(operand1);
848 assert(PyLong_CheckExact(operand1));
849 CHECK_OBJECT(operand2);
851 PyTypeObject *type2 = Py_TYPE(operand2);
853 if (&PyLong_Type == type2) {
861#pragma warning(disable : 4101)
863 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
864 NUITKA_MAY_BE_UNUSED
long clong_result;
869 PyObject *x = PyLong_Type.tp_as_number->nb_and(operand1, operand2);
870 assert(x != Py_NotImplemented);
873 goto exit_result_object;
876 if (unlikely(obj_result == NULL)) {
877 goto exit_result_exception;
879 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
880 Py_DECREF(obj_result);
886 exit_result_exception:
887 return NUITKA_BOOL_EXCEPTION;
890 return __BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(operand1, operand2);
893nuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
894 return _BINARY_OPERATION_BITAND_NBOOL_LONG_OBJECT(operand1, operand2);
897#if PYTHON_VERSION < 0x300
899static PyObject *_BINARY_OPERATION_BITAND_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
900 CHECK_OBJECT(operand1);
901 assert(PyInt_CheckExact(operand1));
902 CHECK_OBJECT(operand2);
903 assert(PyInt_CheckExact(operand2));
910#pragma warning(disable : 4101)
912 NUITKA_MAY_BE_UNUSED
bool cbool_result;
913 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
914 NUITKA_MAY_BE_UNUSED
long clong_result;
915 NUITKA_MAY_BE_UNUSED
double cfloat_result;
920 CHECK_OBJECT(operand1);
921 assert(PyInt_CheckExact(operand1));
922 CHECK_OBJECT(operand2);
923 assert(PyInt_CheckExact(operand2));
925 const long a = PyInt_AS_LONG(operand1);
926 const long b = PyInt_AS_LONG(operand2);
928 const long r = a & b;
931 goto exit_result_ok_clong;
934 result = Nuitka_PyInt_FromLong(clong_result);
941PyObject *BINARY_OPERATION_BITAND_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
942 return _BINARY_OPERATION_BITAND_OBJECT_INT_INT(operand1, operand2);
946#if PYTHON_VERSION < 0x300
948static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1,
949 PyObject *operand2) {
950 PyTypeObject *type1 = Py_TYPE(operand1);
954#pragma warning(disable : 4101)
956 NUITKA_MAY_BE_UNUSED
bool cbool_result;
957 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
963 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
964 binaryfunc slot2 = NULL;
966 if (!(type1 == &PyInt_Type)) {
969 slot2 = PyInt_Type.tp_as_number->nb_and;
971 if (slot1 == slot2) {
977 PyObject *x = slot1(operand1, operand2);
979 if (x != Py_NotImplemented) {
981 goto exit_binary_result_object;
984 Py_DECREF_IMMORTAL(x);
988 PyObject *x = slot2(operand1, operand2);
990 if (x != Py_NotImplemented) {
992 goto exit_binary_result_object;
995 Py_DECREF_IMMORTAL(x);
998#if PYTHON_VERSION < 0x300
999 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1001 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1004 PyObject *coerced1 = operand1;
1005 PyObject *coerced2 = operand2;
1007 int err = c1(&coerced1, &coerced2);
1009 if (unlikely(err < 0)) {
1010 goto exit_binary_exception;
1014 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1016 if (likely(mv == NULL)) {
1017 binaryfunc slot = mv->nb_and;
1019 if (likely(slot != NULL)) {
1020 PyObject *x = slot(coerced1, coerced2);
1022 Py_DECREF(coerced1);
1023 Py_DECREF(coerced2);
1026 goto exit_binary_result_object;
1031 Py_DECREF(coerced1);
1032 Py_DECREF(coerced2);
1035 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
1038 PyObject *coerced1 = operand1;
1039 PyObject *coerced2 = operand2;
1041 int err = c2(&coerced2, &coerced1);
1043 if (unlikely(err < 0)) {
1044 goto exit_binary_exception;
1048 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1050 if (likely(mv == NULL)) {
1051 binaryfunc slot = mv->nb_and;
1053 if (likely(slot != NULL)) {
1054 PyObject *x = slot(coerced1, coerced2);
1056 Py_DECREF(coerced1);
1057 Py_DECREF(coerced2);
1060 goto exit_binary_result_object;
1065 Py_DECREF(coerced1);
1066 Py_DECREF(coerced2);
1072 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'int'", type1->tp_name);
1073 goto exit_binary_exception;
1075exit_binary_result_object:
1078exit_binary_exception:
1081static PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
1082 CHECK_OBJECT(operand1);
1083 CHECK_OBJECT(operand2);
1084 assert(PyInt_CheckExact(operand2));
1086 PyTypeObject *type1 = Py_TYPE(operand1);
1088 if (type1 == &PyInt_Type) {
1094#if defined(_MSC_VER)
1095#pragma warning(push)
1096#pragma warning(disable : 4101)
1098 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1099 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1100 NUITKA_MAY_BE_UNUSED
long clong_result;
1101 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1102#if defined(_MSC_VER)
1106 CHECK_OBJECT(operand1);
1107 assert(PyInt_CheckExact(operand1));
1108 CHECK_OBJECT(operand2);
1109 assert(PyInt_CheckExact(operand2));
1111 const long a = PyInt_AS_LONG(operand1);
1112 const long b = PyInt_AS_LONG(operand2);
1114 const long r = a & b;
1117 goto exit_result_ok_clong;
1119 exit_result_ok_clong:
1120 result = Nuitka_PyInt_FromLong(clong_result);
1121 goto exit_result_ok;
1127 return __BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(operand1, operand2);
1130PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
1131 return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_INT(operand1, operand2);
1135#if PYTHON_VERSION < 0x300
1137static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1,
1138 PyObject *operand2) {
1139 PyTypeObject *type2 = Py_TYPE(operand2);
1141#if defined(_MSC_VER)
1142#pragma warning(push)
1143#pragma warning(disable : 4101)
1145 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1146 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1147#if defined(_MSC_VER)
1151 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_and;
1152 binaryfunc slot2 = NULL;
1154 if (!(&PyInt_Type == type2)) {
1157 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
1159 if (slot1 == slot2) {
1164 if (slot1 != NULL) {
1165 if (slot2 != NULL) {
1166 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
1167 PyObject *x = slot2(operand1, operand2);
1169 if (x != Py_NotImplemented) {
1171 goto exit_binary_result_object;
1174 Py_DECREF_IMMORTAL(x);
1179 PyObject *x = slot1(operand1, operand2);
1181 if (x != Py_NotImplemented) {
1183 goto exit_binary_result_object;
1186 Py_DECREF_IMMORTAL(x);
1189 if (slot2 != NULL) {
1190 PyObject *x = slot2(operand1, operand2);
1192 if (x != Py_NotImplemented) {
1194 goto exit_binary_result_object;
1197 Py_DECREF_IMMORTAL(x);
1200#if PYTHON_VERSION < 0x300
1201 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1202 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
1205 PyObject *coerced1 = operand1;
1206 PyObject *coerced2 = operand2;
1208 int err = c1(&coerced1, &coerced2);
1210 if (unlikely(err < 0)) {
1211 goto exit_binary_exception;
1215 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1217 if (likely(mv == NULL)) {
1218 binaryfunc slot = mv->nb_and;
1220 if (likely(slot != NULL)) {
1221 PyObject *x = slot(coerced1, coerced2);
1223 Py_DECREF(coerced1);
1224 Py_DECREF(coerced2);
1227 goto exit_binary_result_object;
1232 Py_DECREF(coerced1);
1233 Py_DECREF(coerced2);
1237 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1240 PyObject *coerced1 = operand1;
1241 PyObject *coerced2 = operand2;
1243 int err = c2(&coerced2, &coerced1);
1245 if (unlikely(err < 0)) {
1246 goto exit_binary_exception;
1250 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1252 if (likely(mv == NULL)) {
1253 binaryfunc slot = mv->nb_and;
1255 if (likely(slot != NULL)) {
1256 PyObject *x = slot(coerced1, coerced2);
1258 Py_DECREF(coerced1);
1259 Py_DECREF(coerced2);
1262 goto exit_binary_result_object;
1267 Py_DECREF(coerced1);
1268 Py_DECREF(coerced2);
1274 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'int' and '%s'", type2->tp_name);
1275 goto exit_binary_exception;
1277exit_binary_result_object:
1280exit_binary_exception:
1283static PyObject *_BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1284 CHECK_OBJECT(operand1);
1285 assert(PyInt_CheckExact(operand1));
1286 CHECK_OBJECT(operand2);
1288 PyTypeObject *type2 = Py_TYPE(operand2);
1290 if (&PyInt_Type == type2) {
1296#if defined(_MSC_VER)
1297#pragma warning(push)
1298#pragma warning(disable : 4101)
1300 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1301 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1302 NUITKA_MAY_BE_UNUSED
long clong_result;
1303 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1304#if defined(_MSC_VER)
1308 CHECK_OBJECT(operand1);
1309 assert(PyInt_CheckExact(operand1));
1310 CHECK_OBJECT(operand2);
1311 assert(PyInt_CheckExact(operand2));
1313 const long a = PyInt_AS_LONG(operand1);
1314 const long b = PyInt_AS_LONG(operand2);
1316 const long r = a & b;
1319 goto exit_result_ok_clong;
1321 exit_result_ok_clong:
1322 result = Nuitka_PyInt_FromLong(clong_result);
1323 goto exit_result_ok;
1329 return __BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(operand1, operand2);
1332PyObject *BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1333 return _BINARY_OPERATION_BITAND_OBJECT_INT_OBJECT(operand1, operand2);
1337#if PYTHON_VERSION < 0x300
1339static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
1340 CHECK_OBJECT(operand1);
1341 assert(PyInt_CheckExact(operand1));
1342 CHECK_OBJECT(operand2);
1343 assert(PyInt_CheckExact(operand2));
1348#if defined(_MSC_VER)
1349#pragma warning(push)
1350#pragma warning(disable : 4101)
1352 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1353 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1354 NUITKA_MAY_BE_UNUSED
long clong_result;
1355 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1356#if defined(_MSC_VER)
1360 CHECK_OBJECT(operand1);
1361 assert(PyInt_CheckExact(operand1));
1362 CHECK_OBJECT(operand2);
1363 assert(PyInt_CheckExact(operand2));
1365 const long a = PyInt_AS_LONG(operand1);
1366 const long b = PyInt_AS_LONG(operand2);
1368 const long r = a & b;
1371 goto exit_result_ok_clong;
1373exit_result_ok_clong:
1374 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1375 goto exit_result_ok;
1381nuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
1382 return _BINARY_OPERATION_BITAND_NBOOL_INT_INT(operand1, operand2);
1386#if PYTHON_VERSION < 0x300
1388static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1,
1389 PyObject *operand2) {
1390 PyTypeObject *type1 = Py_TYPE(operand1);
1392#if defined(_MSC_VER)
1393#pragma warning(push)
1394#pragma warning(disable : 4101)
1396 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1397 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1398#if defined(_MSC_VER)
1403 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
1404 binaryfunc slot2 = NULL;
1406 if (!(type1 == &PyInt_Type)) {
1409 slot2 = PyInt_Type.tp_as_number->nb_and;
1411 if (slot1 == slot2) {
1416 if (slot1 != NULL) {
1417 PyObject *x = slot1(operand1, operand2);
1419 if (x != Py_NotImplemented) {
1421 goto exit_binary_result_object;
1424 Py_DECREF_IMMORTAL(x);
1427 if (slot2 != NULL) {
1428 PyObject *x = slot2(operand1, operand2);
1430 if (x != Py_NotImplemented) {
1432 goto exit_binary_result_object;
1435 Py_DECREF_IMMORTAL(x);
1438#if PYTHON_VERSION < 0x300
1439 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1441 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1444 PyObject *coerced1 = operand1;
1445 PyObject *coerced2 = operand2;
1447 int err = c1(&coerced1, &coerced2);
1449 if (unlikely(err < 0)) {
1450 goto exit_binary_exception;
1454 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1456 if (likely(mv == NULL)) {
1457 binaryfunc slot = mv->nb_and;
1459 if (likely(slot != NULL)) {
1460 PyObject *x = slot(coerced1, coerced2);
1462 Py_DECREF(coerced1);
1463 Py_DECREF(coerced2);
1466 goto exit_binary_result_object;
1471 Py_DECREF(coerced1);
1472 Py_DECREF(coerced2);
1475 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
1478 PyObject *coerced1 = operand1;
1479 PyObject *coerced2 = operand2;
1481 int err = c2(&coerced2, &coerced1);
1483 if (unlikely(err < 0)) {
1484 goto exit_binary_exception;
1488 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1490 if (likely(mv == NULL)) {
1491 binaryfunc slot = mv->nb_and;
1493 if (likely(slot != NULL)) {
1494 PyObject *x = slot(coerced1, coerced2);
1496 Py_DECREF(coerced1);
1497 Py_DECREF(coerced2);
1500 goto exit_binary_result_object;
1505 Py_DECREF(coerced1);
1506 Py_DECREF(coerced2);
1512 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'int'", type1->tp_name);
1513 goto exit_binary_exception;
1515exit_binary_result_object:
1516 if (unlikely(obj_result == NULL)) {
1517 return NUITKA_BOOL_EXCEPTION;
1521 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1522 Py_DECREF(obj_result);
1526exit_binary_exception:
1527 return NUITKA_BOOL_EXCEPTION;
1529static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
1530 CHECK_OBJECT(operand1);
1531 CHECK_OBJECT(operand2);
1532 assert(PyInt_CheckExact(operand2));
1534 PyTypeObject *type1 = Py_TYPE(operand1);
1536 if (type1 == &PyInt_Type) {
1542#if defined(_MSC_VER)
1543#pragma warning(push)
1544#pragma warning(disable : 4101)
1546 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1547 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1548 NUITKA_MAY_BE_UNUSED
long clong_result;
1549 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1550#if defined(_MSC_VER)
1554 CHECK_OBJECT(operand1);
1555 assert(PyInt_CheckExact(operand1));
1556 CHECK_OBJECT(operand2);
1557 assert(PyInt_CheckExact(operand2));
1559 const long a = PyInt_AS_LONG(operand1);
1560 const long b = PyInt_AS_LONG(operand2);
1562 const long r = a & b;
1565 goto exit_result_ok_clong;
1567 exit_result_ok_clong:
1568 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1569 goto exit_result_ok;
1575 return __BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(operand1, operand2);
1578nuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
1579 return _BINARY_OPERATION_BITAND_NBOOL_OBJECT_INT(operand1, operand2);
1583#if PYTHON_VERSION < 0x300
1585static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1,
1586 PyObject *operand2) {
1587 PyTypeObject *type2 = Py_TYPE(operand2);
1589#if defined(_MSC_VER)
1590#pragma warning(push)
1591#pragma warning(disable : 4101)
1593 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1594 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1595#if defined(_MSC_VER)
1599 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_and;
1600 binaryfunc slot2 = NULL;
1602 if (!(&PyInt_Type == type2)) {
1605 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
1607 if (slot1 == slot2) {
1612 if (slot1 != NULL) {
1613 if (slot2 != NULL) {
1614 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
1615 PyObject *x = slot2(operand1, operand2);
1617 if (x != Py_NotImplemented) {
1619 goto exit_binary_result_object;
1622 Py_DECREF_IMMORTAL(x);
1627 PyObject *x = slot1(operand1, operand2);
1629 if (x != Py_NotImplemented) {
1631 goto exit_binary_result_object;
1634 Py_DECREF_IMMORTAL(x);
1637 if (slot2 != NULL) {
1638 PyObject *x = slot2(operand1, operand2);
1640 if (x != Py_NotImplemented) {
1642 goto exit_binary_result_object;
1645 Py_DECREF_IMMORTAL(x);
1648#if PYTHON_VERSION < 0x300
1649 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1650 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
1653 PyObject *coerced1 = operand1;
1654 PyObject *coerced2 = operand2;
1656 int err = c1(&coerced1, &coerced2);
1658 if (unlikely(err < 0)) {
1659 goto exit_binary_exception;
1663 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1665 if (likely(mv == NULL)) {
1666 binaryfunc slot = mv->nb_and;
1668 if (likely(slot != NULL)) {
1669 PyObject *x = slot(coerced1, coerced2);
1671 Py_DECREF(coerced1);
1672 Py_DECREF(coerced2);
1675 goto exit_binary_result_object;
1680 Py_DECREF(coerced1);
1681 Py_DECREF(coerced2);
1685 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1688 PyObject *coerced1 = operand1;
1689 PyObject *coerced2 = operand2;
1691 int err = c2(&coerced2, &coerced1);
1693 if (unlikely(err < 0)) {
1694 goto exit_binary_exception;
1698 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1700 if (likely(mv == NULL)) {
1701 binaryfunc slot = mv->nb_and;
1703 if (likely(slot != NULL)) {
1704 PyObject *x = slot(coerced1, coerced2);
1706 Py_DECREF(coerced1);
1707 Py_DECREF(coerced2);
1710 goto exit_binary_result_object;
1715 Py_DECREF(coerced1);
1716 Py_DECREF(coerced2);
1722 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'int' and '%s'", type2->tp_name);
1723 goto exit_binary_exception;
1725exit_binary_result_object:
1726 if (unlikely(obj_result == NULL)) {
1727 return NUITKA_BOOL_EXCEPTION;
1731 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1732 Py_DECREF(obj_result);
1736exit_binary_exception:
1737 return NUITKA_BOOL_EXCEPTION;
1739static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1740 CHECK_OBJECT(operand1);
1741 assert(PyInt_CheckExact(operand1));
1742 CHECK_OBJECT(operand2);
1744 PyTypeObject *type2 = Py_TYPE(operand2);
1746 if (&PyInt_Type == type2) {
1752#if defined(_MSC_VER)
1753#pragma warning(push)
1754#pragma warning(disable : 4101)
1756 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1757 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1758 NUITKA_MAY_BE_UNUSED
long clong_result;
1759 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1760#if defined(_MSC_VER)
1764 CHECK_OBJECT(operand1);
1765 assert(PyInt_CheckExact(operand1));
1766 CHECK_OBJECT(operand2);
1767 assert(PyInt_CheckExact(operand2));
1769 const long a = PyInt_AS_LONG(operand1);
1770 const long b = PyInt_AS_LONG(operand2);
1772 const long r = a & b;
1775 goto exit_result_ok_clong;
1777 exit_result_ok_clong:
1778 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1779 goto exit_result_ok;
1785 return __BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(operand1, operand2);
1788nuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1789 return _BINARY_OPERATION_BITAND_NBOOL_INT_OBJECT(operand1, operand2);
1793#if PYTHON_VERSION < 0x300
1795static PyObject *_BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
1796 CHECK_OBJECT(operand1);
1797 assert(PyInt_CheckExact(operand1));
1802#if defined(_MSC_VER)
1803#pragma warning(push)
1804#pragma warning(disable : 4101)
1806 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1807 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1808 NUITKA_MAY_BE_UNUSED
long clong_result;
1809 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1810#if defined(_MSC_VER)
1814 CHECK_OBJECT(operand1);
1815 assert(PyInt_CheckExact(operand1));
1817 const long a = PyInt_AS_LONG(operand1);
1818 const long b = operand2;
1820 const long r = a & b;
1823 goto exit_result_ok_clong;
1825exit_result_ok_clong:
1826 result = Nuitka_PyInt_FromLong(clong_result);
1827 goto exit_result_ok;
1833PyObject *BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
1834 return _BINARY_OPERATION_BITAND_OBJECT_INT_CLONG(operand1, operand2);
1838#if PYTHON_VERSION < 0x300
1840static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(PyObject *operand1,
long operand2) {
1841 CHECK_OBJECT(operand1);
1842 assert(PyInt_CheckExact(operand1));
1847#if defined(_MSC_VER)
1848#pragma warning(push)
1849#pragma warning(disable : 4101)
1851 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1852 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1853 NUITKA_MAY_BE_UNUSED
long clong_result;
1854 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1855#if defined(_MSC_VER)
1859 CHECK_OBJECT(operand1);
1860 assert(PyInt_CheckExact(operand1));
1862 const long a = PyInt_AS_LONG(operand1);
1863 const long b = operand2;
1865 const long r = a & b;
1868 goto exit_result_ok_clong;
1870exit_result_ok_clong:
1871 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1872 goto exit_result_ok;
1878nuitka_bool BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(PyObject *operand1,
long operand2) {
1879 return _BINARY_OPERATION_BITAND_NBOOL_INT_CLONG(operand1, operand2);
1883#if PYTHON_VERSION < 0x300
1885static PyObject *_BINARY_OPERATION_BITAND_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
1886 CHECK_OBJECT(operand1);
1887 assert(PyLong_CheckExact(operand1));
1888 CHECK_OBJECT(operand2);
1889 assert(PyInt_CheckExact(operand2));
1891#if defined(_MSC_VER)
1892#pragma warning(push)
1893#pragma warning(disable : 4101)
1895 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1896 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1897#if defined(_MSC_VER)
1901 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;
1904 if (slot1 != NULL) {
1905 PyObject *x = slot1(operand1, operand2);
1907 if (x != Py_NotImplemented) {
1909 goto exit_binary_result_object;
1912 Py_DECREF_IMMORTAL(x);
1917 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'long' and 'int'");
1918 goto exit_binary_exception;
1920exit_binary_result_object:
1923exit_binary_exception:
1927PyObject *BINARY_OPERATION_BITAND_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
1928 return _BINARY_OPERATION_BITAND_OBJECT_LONG_INT(operand1, operand2);
1932#if PYTHON_VERSION < 0x300
1934static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
1935 CHECK_OBJECT(operand1);
1936 assert(PyLong_CheckExact(operand1));
1937 CHECK_OBJECT(operand2);
1938 assert(PyInt_CheckExact(operand2));
1940#if defined(_MSC_VER)
1941#pragma warning(push)
1942#pragma warning(disable : 4101)
1944 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1945 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1946#if defined(_MSC_VER)
1950 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_and;
1953 if (slot1 != NULL) {
1954 PyObject *x = slot1(operand1, operand2);
1956 if (x != Py_NotImplemented) {
1958 goto exit_binary_result_object;
1961 Py_DECREF_IMMORTAL(x);
1966 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'long' and 'int'");
1967 goto exit_binary_exception;
1969exit_binary_result_object:
1970 if (unlikely(obj_result == NULL)) {
1971 return NUITKA_BOOL_EXCEPTION;
1975 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1976 Py_DECREF(obj_result);
1980exit_binary_exception:
1981 return NUITKA_BOOL_EXCEPTION;
1984nuitka_bool BINARY_OPERATION_BITAND_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
1985 return _BINARY_OPERATION_BITAND_NBOOL_LONG_INT(operand1, operand2);
1990static PyObject *_BINARY_OPERATION_BITAND_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {
1991 CHECK_OBJECT(operand1);
1992 assert(PySet_CheckExact(operand1));
1993 CHECK_OBJECT(operand2);
1994 assert(PySet_CheckExact(operand2));
1999 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2001 PyObject *x = PySet_Type.tp_as_number->nb_and(operand1, operand2);
2003 assert(x != Py_NotImplemented);
2006 goto exit_result_object;
2009 if (unlikely(obj_result == NULL)) {
2010 goto exit_result_exception;
2012 result = obj_result;
2013 goto exit_result_ok;
2018exit_result_exception:
2022PyObject *BINARY_OPERATION_BITAND_OBJECT_SET_SET(PyObject *operand1, PyObject *operand2) {
2023 return _BINARY_OPERATION_BITAND_OBJECT_SET_SET(operand1, operand2);
2027static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1,
2028 PyObject *operand2) {
2029 PyTypeObject *type1 = Py_TYPE(operand1);
2031#if defined(_MSC_VER)
2032#pragma warning(push)
2033#pragma warning(disable : 4101)
2035 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2036 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2037#if defined(_MSC_VER)
2042 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
2043 binaryfunc slot2 = NULL;
2045 if (!(type1 == &PySet_Type)) {
2048 slot2 = PySet_Type.tp_as_number->nb_and;
2050 if (slot1 == slot2) {
2055 if (slot1 != NULL) {
2056 PyObject *x = slot1(operand1, operand2);
2058 if (x != Py_NotImplemented) {
2060 goto exit_binary_result_object;
2063 Py_DECREF_IMMORTAL(x);
2066 if (slot2 != NULL) {
2067 PyObject *x = slot2(operand1, operand2);
2069 if (x != Py_NotImplemented) {
2071 goto exit_binary_result_object;
2074 Py_DECREF_IMMORTAL(x);
2077#if PYTHON_VERSION < 0x300
2078 if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {
2080 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2083 PyObject *coerced1 = operand1;
2084 PyObject *coerced2 = operand2;
2086 int err = c1(&coerced1, &coerced2);
2088 if (unlikely(err < 0)) {
2089 goto exit_binary_exception;
2093 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2095 if (likely(mv == NULL)) {
2096 binaryfunc slot = mv->nb_and;
2098 if (likely(slot != NULL)) {
2099 PyObject *x = slot(coerced1, coerced2);
2101 Py_DECREF(coerced1);
2102 Py_DECREF(coerced2);
2105 goto exit_binary_result_object;
2110 Py_DECREF(coerced1);
2111 Py_DECREF(coerced2);
2117 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and 'set'", type1->tp_name);
2118 goto exit_binary_exception;
2120exit_binary_result_object:
2123exit_binary_exception:
2126static PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {
2127 CHECK_OBJECT(operand1);
2128 CHECK_OBJECT(operand2);
2129 assert(PySet_CheckExact(operand2));
2131 PyTypeObject *type1 = Py_TYPE(operand1);
2133 if (type1 == &PySet_Type) {
2139 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2141 PyObject *x = PySet_Type.tp_as_number->nb_and(operand1, operand2);
2143 assert(x != Py_NotImplemented);
2146 goto exit_result_object;
2149 if (unlikely(obj_result == NULL)) {
2150 goto exit_result_exception;
2152 result = obj_result;
2153 goto exit_result_ok;
2158 exit_result_exception:
2162 return __BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(operand1, operand2);
2165PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(PyObject *operand1, PyObject *operand2) {
2166 return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_SET(operand1, operand2);
2170static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1,
2171 PyObject *operand2) {
2172 PyTypeObject *type2 = Py_TYPE(operand2);
2174#if defined(_MSC_VER)
2175#pragma warning(push)
2176#pragma warning(disable : 4101)
2178 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2179 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2180#if defined(_MSC_VER)
2184 binaryfunc slot1 = PySet_Type.tp_as_number->nb_and;
2185 binaryfunc slot2 = NULL;
2187 if (!(&PySet_Type == type2)) {
2190 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
2192 if (slot1 == slot2) {
2197 if (slot1 != NULL) {
2198 if (slot2 != NULL) {
2199 if (Nuitka_Type_IsSubtype(type2, &PySet_Type)) {
2200 PyObject *x = slot2(operand1, operand2);
2202 if (x != Py_NotImplemented) {
2204 goto exit_binary_result_object;
2207 Py_DECREF_IMMORTAL(x);
2212 PyObject *x = slot1(operand1, operand2);
2214 if (x != Py_NotImplemented) {
2216 goto exit_binary_result_object;
2219 Py_DECREF_IMMORTAL(x);
2222 if (slot2 != NULL) {
2223 PyObject *x = slot2(operand1, operand2);
2225 if (x != Py_NotImplemented) {
2227 goto exit_binary_result_object;
2230 Py_DECREF_IMMORTAL(x);
2233#if PYTHON_VERSION < 0x300
2234 if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
2236 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2239 PyObject *coerced1 = operand1;
2240 PyObject *coerced2 = operand2;
2242 int err = c2(&coerced2, &coerced1);
2244 if (unlikely(err < 0)) {
2245 goto exit_binary_exception;
2249 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2251 if (likely(mv == NULL)) {
2252 binaryfunc slot = mv->nb_and;
2254 if (likely(slot != NULL)) {
2255 PyObject *x = slot(coerced1, coerced2);
2257 Py_DECREF(coerced1);
2258 Py_DECREF(coerced2);
2261 goto exit_binary_result_object;
2266 Py_DECREF(coerced1);
2267 Py_DECREF(coerced2);
2273 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: 'set' and '%s'", type2->tp_name);
2274 goto exit_binary_exception;
2276exit_binary_result_object:
2279exit_binary_exception:
2282static PyObject *_BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {
2283 CHECK_OBJECT(operand1);
2284 assert(PySet_CheckExact(operand1));
2285 CHECK_OBJECT(operand2);
2287 PyTypeObject *type2 = Py_TYPE(operand2);
2289 if (&PySet_Type == type2) {
2295 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2297 PyObject *x = PySet_Type.tp_as_number->nb_and(operand1, operand2);
2299 assert(x != Py_NotImplemented);
2302 goto exit_result_object;
2305 if (unlikely(obj_result == NULL)) {
2306 goto exit_result_exception;
2308 result = obj_result;
2309 goto exit_result_ok;
2314 exit_result_exception:
2318 return __BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(operand1, operand2);
2321PyObject *BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(PyObject *operand1, PyObject *operand2) {
2322 return _BINARY_OPERATION_BITAND_OBJECT_SET_OBJECT(operand1, operand2);
2326static PyObject *_BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
2327 CHECK_OBJECT(operand1);
2328 CHECK_OBJECT(operand2);
2330#if PYTHON_VERSION < 0x300
2331 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
2335#if defined(_MSC_VER)
2336#pragma warning(push)
2337#pragma warning(disable : 4101)
2339 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2340 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2341 NUITKA_MAY_BE_UNUSED
long clong_result;
2342 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2343#if defined(_MSC_VER)
2347 CHECK_OBJECT(operand1);
2348 assert(PyInt_CheckExact(operand1));
2349 CHECK_OBJECT(operand2);
2350 assert(PyInt_CheckExact(operand2));
2352 const long a = PyInt_AS_LONG(operand1);
2353 const long b = PyInt_AS_LONG(operand2);
2355 const long r = a & b;
2358 goto exit_result_ok_clong;
2360 exit_result_ok_clong:
2361 result = Nuitka_PyInt_FromLong(clong_result);
2362 goto exit_result_ok;
2369 PyTypeObject *type1 = Py_TYPE(operand1);
2370 PyTypeObject *type2 = Py_TYPE(operand2);
2372#if defined(_MSC_VER)
2373#pragma warning(push)
2374#pragma warning(disable : 4101)
2376 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2377 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2378#if defined(_MSC_VER)
2383 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
2384 binaryfunc slot2 = NULL;
2386 if (!(type1 == type2)) {
2389 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
2391 if (slot1 == slot2) {
2396 if (slot1 != NULL) {
2397 if (slot2 != NULL) {
2398 if (Nuitka_Type_IsSubtype(type2, type1)) {
2399 PyObject *x = slot2(operand1, operand2);
2401 if (x != Py_NotImplemented) {
2403 goto exit_binary_result_object;
2406 Py_DECREF_IMMORTAL(x);
2411 PyObject *x = slot1(operand1, operand2);
2413 if (x != Py_NotImplemented) {
2415 goto exit_binary_result_object;
2418 Py_DECREF_IMMORTAL(x);
2421 if (slot2 != NULL) {
2422 PyObject *x = slot2(operand1, operand2);
2424 if (x != Py_NotImplemented) {
2426 goto exit_binary_result_object;
2429 Py_DECREF_IMMORTAL(x);
2432#if PYTHON_VERSION < 0x300
2433 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
2435 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2438 PyObject *coerced1 = operand1;
2439 PyObject *coerced2 = operand2;
2441 int err = c1(&coerced1, &coerced2);
2443 if (unlikely(err < 0)) {
2444 goto exit_binary_exception;
2448 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2450 if (likely(mv == NULL)) {
2451 binaryfunc slot = mv->nb_and;
2453 if (likely(slot != NULL)) {
2454 PyObject *x = slot(coerced1, coerced2);
2456 Py_DECREF(coerced1);
2457 Py_DECREF(coerced2);
2460 goto exit_binary_result_object;
2465 Py_DECREF(coerced1);
2466 Py_DECREF(coerced2);
2470 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2473 PyObject *coerced1 = operand1;
2474 PyObject *coerced2 = operand2;
2476 int err = c2(&coerced2, &coerced1);
2478 if (unlikely(err < 0)) {
2479 goto exit_binary_exception;
2483 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2485 if (likely(mv == NULL)) {
2486 binaryfunc slot = mv->nb_and;
2488 if (likely(slot != NULL)) {
2489 PyObject *x = slot(coerced1, coerced2);
2491 Py_DECREF(coerced1);
2492 Py_DECREF(coerced2);
2495 goto exit_binary_result_object;
2500 Py_DECREF(coerced1);
2501 Py_DECREF(coerced2);
2507 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and '%s'", type1->tp_name, type2->tp_name);
2508 goto exit_binary_exception;
2510exit_binary_result_object:
2513exit_binary_exception:
2517PyObject *BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
2518 return _BINARY_OPERATION_BITAND_OBJECT_OBJECT_OBJECT(operand1, operand2);
2522static nuitka_bool _BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
2523 CHECK_OBJECT(operand1);
2524 CHECK_OBJECT(operand2);
2526#if PYTHON_VERSION < 0x300
2527 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
2531#if defined(_MSC_VER)
2532#pragma warning(push)
2533#pragma warning(disable : 4101)
2535 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2536 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2537 NUITKA_MAY_BE_UNUSED
long clong_result;
2538 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2539#if defined(_MSC_VER)
2543 CHECK_OBJECT(operand1);
2544 assert(PyInt_CheckExact(operand1));
2545 CHECK_OBJECT(operand2);
2546 assert(PyInt_CheckExact(operand2));
2548 const long a = PyInt_AS_LONG(operand1);
2549 const long b = PyInt_AS_LONG(operand2);
2551 const long r = a & b;
2554 goto exit_result_ok_clong;
2556 exit_result_ok_clong:
2557 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2558 goto exit_result_ok;
2565 PyTypeObject *type1 = Py_TYPE(operand1);
2566 PyTypeObject *type2 = Py_TYPE(operand2);
2568#if defined(_MSC_VER)
2569#pragma warning(push)
2570#pragma warning(disable : 4101)
2572 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2573 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2574#if defined(_MSC_VER)
2579 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_and : NULL;
2580 binaryfunc slot2 = NULL;
2582 if (!(type1 == type2)) {
2585 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_and : NULL;
2587 if (slot1 == slot2) {
2592 if (slot1 != NULL) {
2593 if (slot2 != NULL) {
2594 if (Nuitka_Type_IsSubtype(type2, type1)) {
2595 PyObject *x = slot2(operand1, operand2);
2597 if (x != Py_NotImplemented) {
2599 goto exit_binary_result_object;
2602 Py_DECREF_IMMORTAL(x);
2607 PyObject *x = slot1(operand1, operand2);
2609 if (x != Py_NotImplemented) {
2611 goto exit_binary_result_object;
2614 Py_DECREF_IMMORTAL(x);
2617 if (slot2 != NULL) {
2618 PyObject *x = slot2(operand1, operand2);
2620 if (x != Py_NotImplemented) {
2622 goto exit_binary_result_object;
2625 Py_DECREF_IMMORTAL(x);
2628#if PYTHON_VERSION < 0x300
2629 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
2631 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2634 PyObject *coerced1 = operand1;
2635 PyObject *coerced2 = operand2;
2637 int err = c1(&coerced1, &coerced2);
2639 if (unlikely(err < 0)) {
2640 goto exit_binary_exception;
2644 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2646 if (likely(mv == NULL)) {
2647 binaryfunc slot = mv->nb_and;
2649 if (likely(slot != NULL)) {
2650 PyObject *x = slot(coerced1, coerced2);
2652 Py_DECREF(coerced1);
2653 Py_DECREF(coerced2);
2656 goto exit_binary_result_object;
2661 Py_DECREF(coerced1);
2662 Py_DECREF(coerced2);
2666 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2669 PyObject *coerced1 = operand1;
2670 PyObject *coerced2 = operand2;
2672 int err = c2(&coerced2, &coerced1);
2674 if (unlikely(err < 0)) {
2675 goto exit_binary_exception;
2679 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2681 if (likely(mv == NULL)) {
2682 binaryfunc slot = mv->nb_and;
2684 if (likely(slot != NULL)) {
2685 PyObject *x = slot(coerced1, coerced2);
2687 Py_DECREF(coerced1);
2688 Py_DECREF(coerced2);
2691 goto exit_binary_result_object;
2696 Py_DECREF(coerced1);
2697 Py_DECREF(coerced2);
2703 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for &: '%s' and '%s'", type1->tp_name, type2->tp_name);
2704 goto exit_binary_exception;
2706exit_binary_result_object:
2707 if (unlikely(obj_result == NULL)) {
2708 return NUITKA_BOOL_EXCEPTION;
2712 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2713 Py_DECREF(obj_result);
2717exit_binary_exception:
2718 return NUITKA_BOOL_EXCEPTION;
2721nuitka_bool BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
2722 return _BINARY_OPERATION_BITAND_NBOOL_OBJECT_OBJECT(operand1, operand2);