7#include "nuitka/prelude.h"
12#if PYTHON_VERSION < 0x300
14static PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
15 CHECK_OBJECT(operand1);
16 assert(PyInt_CheckExact(operand1));
17 CHECK_OBJECT(operand2);
18 assert(PyInt_CheckExact(operand2));
25#pragma warning(disable : 4101)
27 NUITKA_MAY_BE_UNUSED
bool cbool_result;
28 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
29 NUITKA_MAY_BE_UNUSED
long clong_result;
30 NUITKA_MAY_BE_UNUSED
double cfloat_result;
35 CHECK_OBJECT(operand1);
36 assert(PyInt_CheckExact(operand1));
37 CHECK_OBJECT(operand2);
38 assert(PyInt_CheckExact(operand2));
40 const long a = PyInt_AS_LONG(operand1);
41 const long b = PyInt_AS_LONG(operand2);
49 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
53 if (r != 0 && ((b ^ r) < 0)) {
58 goto exit_result_ok_clong;
62 PyObject *operand1_object = operand1;
63 PyObject *operand2_object = operand2;
65 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
66 assert(r != Py_NotImplemented);
69 goto exit_result_object;
73 result = Nuitka_PyInt_FromLong(clong_result);
77 if (unlikely(obj_result == NULL)) {
78 goto exit_result_exception;
90PyObject *BINARY_OPERATION_MOD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
91 return _BINARY_OPERATION_MOD_OBJECT_INT_INT(operand1, operand2);
95#if PYTHON_VERSION < 0x300
97static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
98 PyTypeObject *type1 = Py_TYPE(operand1);
102#pragma warning(disable : 4101)
104 NUITKA_MAY_BE_UNUSED
bool cbool_result;
105 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
111 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
112 binaryfunc slot2 = NULL;
114 if (!(type1 == &PyInt_Type)) {
117 slot2 = PyInt_Type.tp_as_number->nb_remainder;
119 if (slot1 == slot2) {
125 PyObject *x = slot1(operand1, operand2);
127 if (x != Py_NotImplemented) {
129 goto exit_binary_result_object;
132 Py_DECREF_IMMORTAL(x);
136 PyObject *x = slot2(operand1, operand2);
138 if (x != Py_NotImplemented) {
140 goto exit_binary_result_object;
143 Py_DECREF_IMMORTAL(x);
146#if PYTHON_VERSION < 0x300
147 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
149 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
152 PyObject *coerced1 = operand1;
153 PyObject *coerced2 = operand2;
155 int err = c1(&coerced1, &coerced2);
157 if (unlikely(err < 0)) {
158 goto exit_binary_exception;
162 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
164 if (likely(mv == NULL)) {
165 binaryfunc slot = mv->nb_remainder;
167 if (likely(slot != NULL)) {
168 PyObject *x = slot(coerced1, coerced2);
174 goto exit_binary_result_object;
183 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
186 PyObject *coerced1 = operand1;
187 PyObject *coerced2 = operand2;
189 int err = c2(&coerced2, &coerced1);
191 if (unlikely(err < 0)) {
192 goto exit_binary_exception;
196 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
198 if (likely(mv == NULL)) {
199 binaryfunc slot = mv->nb_remainder;
201 if (likely(slot != NULL)) {
202 PyObject *x = slot(coerced1, coerced2);
208 goto exit_binary_result_object;
220 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'int'", type1->tp_name);
221 goto exit_binary_exception;
223exit_binary_result_object:
226exit_binary_exception:
229static PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
230 CHECK_OBJECT(operand1);
231 CHECK_OBJECT(operand2);
232 assert(PyInt_CheckExact(operand2));
234 PyTypeObject *type1 = Py_TYPE(operand1);
236 if (type1 == &PyInt_Type) {
244#pragma warning(disable : 4101)
246 NUITKA_MAY_BE_UNUSED
bool cbool_result;
247 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
248 NUITKA_MAY_BE_UNUSED
long clong_result;
249 NUITKA_MAY_BE_UNUSED
double cfloat_result;
254 CHECK_OBJECT(operand1);
255 assert(PyInt_CheckExact(operand1));
256 CHECK_OBJECT(operand2);
257 assert(PyInt_CheckExact(operand2));
259 const long a = PyInt_AS_LONG(operand1);
260 const long b = PyInt_AS_LONG(operand2);
268 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
272 if (r != 0 && ((b ^ r) < 0)) {
277 goto exit_result_ok_clong;
281 PyObject *operand1_object = operand1;
282 PyObject *operand2_object = operand2;
284 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
285 assert(r != Py_NotImplemented);
288 goto exit_result_object;
291 exit_result_ok_clong:
292 result = Nuitka_PyInt_FromLong(clong_result);
296 if (unlikely(obj_result == NULL)) {
297 goto exit_result_exception;
305 exit_result_exception:
309 return __BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(operand1, operand2);
312PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
313 return _BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(operand1, operand2);
317#if PYTHON_VERSION < 0x300
319static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
320 PyTypeObject *type2 = Py_TYPE(operand2);
324#pragma warning(disable : 4101)
326 NUITKA_MAY_BE_UNUSED
bool cbool_result;
327 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
332 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_remainder;
333 binaryfunc slot2 = NULL;
335 if (!(&PyInt_Type == type2)) {
339 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
341 if (slot1 == slot2) {
348 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
349 PyObject *x = slot2(operand1, operand2);
351 if (x != Py_NotImplemented) {
353 goto exit_binary_result_object;
356 Py_DECREF_IMMORTAL(x);
361 PyObject *x = slot1(operand1, operand2);
363 if (x != Py_NotImplemented) {
365 goto exit_binary_result_object;
368 Py_DECREF_IMMORTAL(x);
372 PyObject *x = slot2(operand1, operand2);
374 if (x != Py_NotImplemented) {
376 goto exit_binary_result_object;
379 Py_DECREF_IMMORTAL(x);
382#if PYTHON_VERSION < 0x300
383 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
384 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
387 PyObject *coerced1 = operand1;
388 PyObject *coerced2 = operand2;
390 int err = c1(&coerced1, &coerced2);
392 if (unlikely(err < 0)) {
393 goto exit_binary_exception;
397 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
399 if (likely(mv == NULL)) {
400 binaryfunc slot = mv->nb_remainder;
402 if (likely(slot != NULL)) {
403 PyObject *x = slot(coerced1, coerced2);
409 goto exit_binary_result_object;
419 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
422 PyObject *coerced1 = operand1;
423 PyObject *coerced2 = operand2;
425 int err = c2(&coerced2, &coerced1);
427 if (unlikely(err < 0)) {
428 goto exit_binary_exception;
432 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
434 if (likely(mv == NULL)) {
435 binaryfunc slot = mv->nb_remainder;
437 if (likely(slot != NULL)) {
438 PyObject *x = slot(coerced1, coerced2);
444 goto exit_binary_result_object;
456 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and '%s'", type2->tp_name);
457 goto exit_binary_exception;
459exit_binary_result_object:
462exit_binary_exception:
465static PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
466 CHECK_OBJECT(operand1);
467 assert(PyInt_CheckExact(operand1));
468 CHECK_OBJECT(operand2);
470 PyTypeObject *type2 = Py_TYPE(operand2);
472 if (&PyInt_Type == type2) {
480#pragma warning(disable : 4101)
482 NUITKA_MAY_BE_UNUSED
bool cbool_result;
483 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
484 NUITKA_MAY_BE_UNUSED
long clong_result;
485 NUITKA_MAY_BE_UNUSED
double cfloat_result;
490 CHECK_OBJECT(operand1);
491 assert(PyInt_CheckExact(operand1));
492 CHECK_OBJECT(operand2);
493 assert(PyInt_CheckExact(operand2));
495 const long a = PyInt_AS_LONG(operand1);
496 const long b = PyInt_AS_LONG(operand2);
504 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
508 if (r != 0 && ((b ^ r) < 0)) {
513 goto exit_result_ok_clong;
517 PyObject *operand1_object = operand1;
518 PyObject *operand2_object = operand2;
520 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
521 assert(r != Py_NotImplemented);
524 goto exit_result_object;
527 exit_result_ok_clong:
528 result = Nuitka_PyInt_FromLong(clong_result);
532 if (unlikely(obj_result == NULL)) {
533 goto exit_result_exception;
541 exit_result_exception:
545 return __BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(operand1, operand2);
548PyObject *BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
549 return _BINARY_OPERATION_MOD_OBJECT_INT_OBJECT(operand1, operand2);
553#if PYTHON_VERSION < 0x300
555static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
556 CHECK_OBJECT(operand1);
557 assert(PyInt_CheckExact(operand1));
558 CHECK_OBJECT(operand2);
559 assert(PyInt_CheckExact(operand2));
566#pragma warning(disable : 4101)
568 NUITKA_MAY_BE_UNUSED
bool cbool_result;
569 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
570 NUITKA_MAY_BE_UNUSED
long clong_result;
571 NUITKA_MAY_BE_UNUSED
double cfloat_result;
576 CHECK_OBJECT(operand1);
577 assert(PyInt_CheckExact(operand1));
578 CHECK_OBJECT(operand2);
579 assert(PyInt_CheckExact(operand2));
581 const long a = PyInt_AS_LONG(operand1);
582 const long b = PyInt_AS_LONG(operand2);
590 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
594 if (r != 0 && ((b ^ r) < 0)) {
599 goto exit_result_ok_clong;
603 PyObject *operand1_object = operand1;
604 PyObject *operand2_object = operand2;
606 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
607 assert(r != Py_NotImplemented);
610 goto exit_result_object;
614 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
618 if (unlikely(obj_result == NULL)) {
619 goto exit_result_exception;
621 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
622 Py_DECREF(obj_result);
628exit_result_exception:
629 return NUITKA_BOOL_EXCEPTION;
632nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
633 return _BINARY_OPERATION_MOD_NBOOL_INT_INT(operand1, operand2);
637#if PYTHON_VERSION < 0x300
639static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
640 PyTypeObject *type1 = Py_TYPE(operand1);
644#pragma warning(disable : 4101)
646 NUITKA_MAY_BE_UNUSED
bool cbool_result;
647 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
653 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
654 binaryfunc slot2 = NULL;
656 if (!(type1 == &PyInt_Type)) {
659 slot2 = PyInt_Type.tp_as_number->nb_remainder;
661 if (slot1 == slot2) {
667 PyObject *x = slot1(operand1, operand2);
669 if (x != Py_NotImplemented) {
671 goto exit_binary_result_object;
674 Py_DECREF_IMMORTAL(x);
678 PyObject *x = slot2(operand1, operand2);
680 if (x != Py_NotImplemented) {
682 goto exit_binary_result_object;
685 Py_DECREF_IMMORTAL(x);
688#if PYTHON_VERSION < 0x300
689 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
691 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
694 PyObject *coerced1 = operand1;
695 PyObject *coerced2 = operand2;
697 int err = c1(&coerced1, &coerced2);
699 if (unlikely(err < 0)) {
700 goto exit_binary_exception;
704 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
706 if (likely(mv == NULL)) {
707 binaryfunc slot = mv->nb_remainder;
709 if (likely(slot != NULL)) {
710 PyObject *x = slot(coerced1, coerced2);
716 goto exit_binary_result_object;
725 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
728 PyObject *coerced1 = operand1;
729 PyObject *coerced2 = operand2;
731 int err = c2(&coerced2, &coerced1);
733 if (unlikely(err < 0)) {
734 goto exit_binary_exception;
738 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
740 if (likely(mv == NULL)) {
741 binaryfunc slot = mv->nb_remainder;
743 if (likely(slot != NULL)) {
744 PyObject *x = slot(coerced1, coerced2);
750 goto exit_binary_result_object;
762 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'int'", type1->tp_name);
763 goto exit_binary_exception;
765exit_binary_result_object:
766 if (unlikely(obj_result == NULL)) {
767 return NUITKA_BOOL_EXCEPTION;
771 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
772 Py_DECREF(obj_result);
776exit_binary_exception:
777 return NUITKA_BOOL_EXCEPTION;
779static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
780 CHECK_OBJECT(operand1);
781 CHECK_OBJECT(operand2);
782 assert(PyInt_CheckExact(operand2));
784 PyTypeObject *type1 = Py_TYPE(operand1);
786 if (type1 == &PyInt_Type) {
794#pragma warning(disable : 4101)
796 NUITKA_MAY_BE_UNUSED
bool cbool_result;
797 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
798 NUITKA_MAY_BE_UNUSED
long clong_result;
799 NUITKA_MAY_BE_UNUSED
double cfloat_result;
804 CHECK_OBJECT(operand1);
805 assert(PyInt_CheckExact(operand1));
806 CHECK_OBJECT(operand2);
807 assert(PyInt_CheckExact(operand2));
809 const long a = PyInt_AS_LONG(operand1);
810 const long b = PyInt_AS_LONG(operand2);
818 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
822 if (r != 0 && ((b ^ r) < 0)) {
827 goto exit_result_ok_clong;
831 PyObject *operand1_object = operand1;
832 PyObject *operand2_object = operand2;
834 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
835 assert(r != Py_NotImplemented);
838 goto exit_result_object;
841 exit_result_ok_clong:
842 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
846 if (unlikely(obj_result == NULL)) {
847 goto exit_result_exception;
849 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
850 Py_DECREF(obj_result);
856 exit_result_exception:
857 return NUITKA_BOOL_EXCEPTION;
860 return __BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(operand1, operand2);
863nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
864 return _BINARY_OPERATION_MOD_NBOOL_OBJECT_INT(operand1, operand2);
868#if PYTHON_VERSION < 0x300
870static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
871 PyTypeObject *type2 = Py_TYPE(operand2);
875#pragma warning(disable : 4101)
877 NUITKA_MAY_BE_UNUSED
bool cbool_result;
878 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
883 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_remainder;
884 binaryfunc slot2 = NULL;
886 if (!(&PyInt_Type == type2)) {
890 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
892 if (slot1 == slot2) {
899 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
900 PyObject *x = slot2(operand1, operand2);
902 if (x != Py_NotImplemented) {
904 goto exit_binary_result_object;
907 Py_DECREF_IMMORTAL(x);
912 PyObject *x = slot1(operand1, operand2);
914 if (x != Py_NotImplemented) {
916 goto exit_binary_result_object;
919 Py_DECREF_IMMORTAL(x);
923 PyObject *x = slot2(operand1, operand2);
925 if (x != Py_NotImplemented) {
927 goto exit_binary_result_object;
930 Py_DECREF_IMMORTAL(x);
933#if PYTHON_VERSION < 0x300
934 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
935 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
938 PyObject *coerced1 = operand1;
939 PyObject *coerced2 = operand2;
941 int err = c1(&coerced1, &coerced2);
943 if (unlikely(err < 0)) {
944 goto exit_binary_exception;
948 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
950 if (likely(mv == NULL)) {
951 binaryfunc slot = mv->nb_remainder;
953 if (likely(slot != NULL)) {
954 PyObject *x = slot(coerced1, coerced2);
960 goto exit_binary_result_object;
970 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
973 PyObject *coerced1 = operand1;
974 PyObject *coerced2 = operand2;
976 int err = c2(&coerced2, &coerced1);
978 if (unlikely(err < 0)) {
979 goto exit_binary_exception;
983 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
985 if (likely(mv == NULL)) {
986 binaryfunc slot = mv->nb_remainder;
988 if (likely(slot != NULL)) {
989 PyObject *x = slot(coerced1, coerced2);
995 goto exit_binary_result_object;
1000 Py_DECREF(coerced1);
1001 Py_DECREF(coerced2);
1007 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and '%s'", type2->tp_name);
1008 goto exit_binary_exception;
1010exit_binary_result_object:
1011 if (unlikely(obj_result == NULL)) {
1012 return NUITKA_BOOL_EXCEPTION;
1016 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1017 Py_DECREF(obj_result);
1021exit_binary_exception:
1022 return NUITKA_BOOL_EXCEPTION;
1024static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1025 CHECK_OBJECT(operand1);
1026 assert(PyInt_CheckExact(operand1));
1027 CHECK_OBJECT(operand2);
1029 PyTypeObject *type2 = Py_TYPE(operand2);
1031 if (&PyInt_Type == type2) {
1037#if defined(_MSC_VER)
1038#pragma warning(push)
1039#pragma warning(disable : 4101)
1041 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1042 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1043 NUITKA_MAY_BE_UNUSED
long clong_result;
1044 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1045#if defined(_MSC_VER)
1049 CHECK_OBJECT(operand1);
1050 assert(PyInt_CheckExact(operand1));
1051 CHECK_OBJECT(operand2);
1052 assert(PyInt_CheckExact(operand2));
1054 const long a = PyInt_AS_LONG(operand1);
1055 const long b = PyInt_AS_LONG(operand2);
1063 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
1067 if (r != 0 && ((b ^ r) < 0)) {
1072 goto exit_result_ok_clong;
1076 PyObject *operand1_object = operand1;
1077 PyObject *operand2_object = operand2;
1079 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
1080 assert(r != Py_NotImplemented);
1083 goto exit_result_object;
1086 exit_result_ok_clong:
1087 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1088 goto exit_result_ok;
1091 if (unlikely(obj_result == NULL)) {
1092 goto exit_result_exception;
1094 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1095 Py_DECREF(obj_result);
1096 goto exit_result_ok;
1101 exit_result_exception:
1102 return NUITKA_BOOL_EXCEPTION;
1105 return __BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(operand1, operand2);
1108nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1109 return _BINARY_OPERATION_MOD_NBOOL_INT_OBJECT(operand1, operand2);
1114static PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1115 CHECK_OBJECT(operand1);
1116 assert(PyLong_CheckExact(operand1));
1117 CHECK_OBJECT(operand2);
1118 assert(PyLong_CheckExact(operand2));
1123#if defined(_MSC_VER)
1124#pragma warning(push)
1125#pragma warning(disable : 4101)
1127 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1128 NUITKA_MAY_BE_UNUSED
long clong_result;
1129#if defined(_MSC_VER)
1133 PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);
1134 assert(x != Py_NotImplemented);
1137 goto exit_result_object;
1140 if (unlikely(obj_result == NULL)) {
1141 goto exit_result_exception;
1143 result = obj_result;
1144 goto exit_result_ok;
1149exit_result_exception:
1153PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1154 return _BINARY_OPERATION_MOD_OBJECT_LONG_LONG(operand1, operand2);
1158static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1159 PyTypeObject *type1 = Py_TYPE(operand1);
1161#if defined(_MSC_VER)
1162#pragma warning(push)
1163#pragma warning(disable : 4101)
1165 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1166 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1167#if defined(_MSC_VER)
1172 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
1173 binaryfunc slot2 = NULL;
1175 if (!(type1 == &PyLong_Type)) {
1178 slot2 = PyLong_Type.tp_as_number->nb_remainder;
1180 if (slot1 == slot2) {
1185 if (slot1 != NULL) {
1186 PyObject *x = slot1(operand1, operand2);
1188 if (x != Py_NotImplemented) {
1190 goto exit_binary_result_object;
1193 Py_DECREF_IMMORTAL(x);
1196 if (slot2 != NULL) {
1197 PyObject *x = slot2(operand1, operand2);
1199 if (x != Py_NotImplemented) {
1201 goto exit_binary_result_object;
1204 Py_DECREF_IMMORTAL(x);
1207#if PYTHON_VERSION < 0x300
1208 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1210 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1213 PyObject *coerced1 = operand1;
1214 PyObject *coerced2 = operand2;
1216 int err = c1(&coerced1, &coerced2);
1218 if (unlikely(err < 0)) {
1219 goto exit_binary_exception;
1223 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1225 if (likely(mv == NULL)) {
1226 binaryfunc slot = mv->nb_remainder;
1228 if (likely(slot != NULL)) {
1229 PyObject *x = slot(coerced1, coerced2);
1231 Py_DECREF(coerced1);
1232 Py_DECREF(coerced2);
1235 goto exit_binary_result_object;
1240 Py_DECREF(coerced1);
1241 Py_DECREF(coerced2);
1244 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
1247 PyObject *coerced1 = operand1;
1248 PyObject *coerced2 = operand2;
1250 int err = c2(&coerced2, &coerced1);
1252 if (unlikely(err < 0)) {
1253 goto exit_binary_exception;
1257 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1259 if (likely(mv == NULL)) {
1260 binaryfunc slot = mv->nb_remainder;
1262 if (likely(slot != NULL)) {
1263 PyObject *x = slot(coerced1, coerced2);
1265 Py_DECREF(coerced1);
1266 Py_DECREF(coerced2);
1269 goto exit_binary_result_object;
1274 Py_DECREF(coerced1);
1275 Py_DECREF(coerced2);
1281#if PYTHON_VERSION < 0x300
1282 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'long'", type1->tp_name);
1284 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'int'", type1->tp_name);
1286 goto exit_binary_exception;
1288exit_binary_result_object:
1291exit_binary_exception:
1294static PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1295 CHECK_OBJECT(operand1);
1296 CHECK_OBJECT(operand2);
1297 assert(PyLong_CheckExact(operand2));
1299 PyTypeObject *type1 = Py_TYPE(operand1);
1301 if (type1 == &PyLong_Type) {
1307#if defined(_MSC_VER)
1308#pragma warning(push)
1309#pragma warning(disable : 4101)
1311 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1312 NUITKA_MAY_BE_UNUSED
long clong_result;
1313#if defined(_MSC_VER)
1317 PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);
1318 assert(x != Py_NotImplemented);
1321 goto exit_result_object;
1324 if (unlikely(obj_result == NULL)) {
1325 goto exit_result_exception;
1327 result = obj_result;
1328 goto exit_result_ok;
1333 exit_result_exception:
1337 return __BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(operand1, operand2);
1340PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1341 return _BINARY_OPERATION_MOD_OBJECT_OBJECT_LONG(operand1, operand2);
1345static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1346 PyTypeObject *type2 = Py_TYPE(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#if defined(_MSC_VER)
1358 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;
1359 binaryfunc slot2 = NULL;
1361 if (!(&PyLong_Type == type2)) {
1365 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
1367 if (slot1 == slot2) {
1372 if (slot1 != NULL) {
1373 if (slot2 != NULL) {
1374 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
1375 PyObject *x = slot2(operand1, operand2);
1377 if (x != Py_NotImplemented) {
1379 goto exit_binary_result_object;
1382 Py_DECREF_IMMORTAL(x);
1387 PyObject *x = slot1(operand1, operand2);
1389 if (x != Py_NotImplemented) {
1391 goto exit_binary_result_object;
1394 Py_DECREF_IMMORTAL(x);
1397 if (slot2 != NULL) {
1398 PyObject *x = slot2(operand1, operand2);
1400 if (x != Py_NotImplemented) {
1402 goto exit_binary_result_object;
1405 Py_DECREF_IMMORTAL(x);
1408#if PYTHON_VERSION < 0x300
1409 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1410 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
1413 PyObject *coerced1 = operand1;
1414 PyObject *coerced2 = operand2;
1416 int err = c1(&coerced1, &coerced2);
1418 if (unlikely(err < 0)) {
1419 goto exit_binary_exception;
1423 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1425 if (likely(mv == NULL)) {
1426 binaryfunc slot = mv->nb_remainder;
1428 if (likely(slot != NULL)) {
1429 PyObject *x = slot(coerced1, coerced2);
1431 Py_DECREF(coerced1);
1432 Py_DECREF(coerced2);
1435 goto exit_binary_result_object;
1440 Py_DECREF(coerced1);
1441 Py_DECREF(coerced2);
1445 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1448 PyObject *coerced1 = operand1;
1449 PyObject *coerced2 = operand2;
1451 int err = c2(&coerced2, &coerced1);
1453 if (unlikely(err < 0)) {
1454 goto exit_binary_exception;
1458 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1460 if (likely(mv == NULL)) {
1461 binaryfunc slot = mv->nb_remainder;
1463 if (likely(slot != NULL)) {
1464 PyObject *x = slot(coerced1, coerced2);
1466 Py_DECREF(coerced1);
1467 Py_DECREF(coerced2);
1470 goto exit_binary_result_object;
1475 Py_DECREF(coerced1);
1476 Py_DECREF(coerced2);
1482#if PYTHON_VERSION < 0x300
1483 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'long' and '%s'", type2->tp_name);
1485 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and '%s'", type2->tp_name);
1487 goto exit_binary_exception;
1489exit_binary_result_object:
1492exit_binary_exception:
1495static PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1496 CHECK_OBJECT(operand1);
1497 assert(PyLong_CheckExact(operand1));
1498 CHECK_OBJECT(operand2);
1500 PyTypeObject *type2 = Py_TYPE(operand2);
1502 if (&PyLong_Type == type2) {
1508#if defined(_MSC_VER)
1509#pragma warning(push)
1510#pragma warning(disable : 4101)
1512 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1513 NUITKA_MAY_BE_UNUSED
long clong_result;
1514#if defined(_MSC_VER)
1518 PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);
1519 assert(x != Py_NotImplemented);
1522 goto exit_result_object;
1525 if (unlikely(obj_result == NULL)) {
1526 goto exit_result_exception;
1528 result = obj_result;
1529 goto exit_result_ok;
1534 exit_result_exception:
1538 return __BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(operand1, operand2);
1541PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1542 return _BINARY_OPERATION_MOD_OBJECT_LONG_OBJECT(operand1, operand2);
1546static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1547 CHECK_OBJECT(operand1);
1548 assert(PyLong_CheckExact(operand1));
1549 CHECK_OBJECT(operand2);
1550 assert(PyLong_CheckExact(operand2));
1555#if defined(_MSC_VER)
1556#pragma warning(push)
1557#pragma warning(disable : 4101)
1559 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1560 NUITKA_MAY_BE_UNUSED
long clong_result;
1561#if defined(_MSC_VER)
1565 PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);
1566 assert(x != Py_NotImplemented);
1569 goto exit_result_object;
1572 if (unlikely(obj_result == NULL)) {
1573 goto exit_result_exception;
1575 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1576 Py_DECREF(obj_result);
1577 goto exit_result_ok;
1582exit_result_exception:
1583 return NUITKA_BOOL_EXCEPTION;
1586nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1587 return _BINARY_OPERATION_MOD_NBOOL_LONG_LONG(operand1, operand2);
1591static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1,
1592 PyObject *operand2) {
1593 PyTypeObject *type1 = Py_TYPE(operand1);
1595#if defined(_MSC_VER)
1596#pragma warning(push)
1597#pragma warning(disable : 4101)
1599 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1600 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1601#if defined(_MSC_VER)
1606 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
1607 binaryfunc slot2 = NULL;
1609 if (!(type1 == &PyLong_Type)) {
1612 slot2 = PyLong_Type.tp_as_number->nb_remainder;
1614 if (slot1 == slot2) {
1619 if (slot1 != NULL) {
1620 PyObject *x = slot1(operand1, operand2);
1622 if (x != Py_NotImplemented) {
1624 goto exit_binary_result_object;
1627 Py_DECREF_IMMORTAL(x);
1630 if (slot2 != NULL) {
1631 PyObject *x = slot2(operand1, operand2);
1633 if (x != Py_NotImplemented) {
1635 goto exit_binary_result_object;
1638 Py_DECREF_IMMORTAL(x);
1641#if PYTHON_VERSION < 0x300
1642 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1644 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1647 PyObject *coerced1 = operand1;
1648 PyObject *coerced2 = operand2;
1650 int err = c1(&coerced1, &coerced2);
1652 if (unlikely(err < 0)) {
1653 goto exit_binary_exception;
1657 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1659 if (likely(mv == NULL)) {
1660 binaryfunc slot = mv->nb_remainder;
1662 if (likely(slot != NULL)) {
1663 PyObject *x = slot(coerced1, coerced2);
1665 Py_DECREF(coerced1);
1666 Py_DECREF(coerced2);
1669 goto exit_binary_result_object;
1674 Py_DECREF(coerced1);
1675 Py_DECREF(coerced2);
1678 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
1681 PyObject *coerced1 = operand1;
1682 PyObject *coerced2 = operand2;
1684 int err = c2(&coerced2, &coerced1);
1686 if (unlikely(err < 0)) {
1687 goto exit_binary_exception;
1691 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1693 if (likely(mv == NULL)) {
1694 binaryfunc slot = mv->nb_remainder;
1696 if (likely(slot != NULL)) {
1697 PyObject *x = slot(coerced1, coerced2);
1699 Py_DECREF(coerced1);
1700 Py_DECREF(coerced2);
1703 goto exit_binary_result_object;
1708 Py_DECREF(coerced1);
1709 Py_DECREF(coerced2);
1715#if PYTHON_VERSION < 0x300
1716 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'long'", type1->tp_name);
1718 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'int'", type1->tp_name);
1720 goto exit_binary_exception;
1722exit_binary_result_object:
1723 if (unlikely(obj_result == NULL)) {
1724 return NUITKA_BOOL_EXCEPTION;
1728 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1729 Py_DECREF(obj_result);
1733exit_binary_exception:
1734 return NUITKA_BOOL_EXCEPTION;
1736static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1737 CHECK_OBJECT(operand1);
1738 CHECK_OBJECT(operand2);
1739 assert(PyLong_CheckExact(operand2));
1741 PyTypeObject *type1 = Py_TYPE(operand1);
1743 if (type1 == &PyLong_Type) {
1749#if defined(_MSC_VER)
1750#pragma warning(push)
1751#pragma warning(disable : 4101)
1753 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1754 NUITKA_MAY_BE_UNUSED
long clong_result;
1755#if defined(_MSC_VER)
1759 PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);
1760 assert(x != Py_NotImplemented);
1763 goto exit_result_object;
1766 if (unlikely(obj_result == NULL)) {
1767 goto exit_result_exception;
1769 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1770 Py_DECREF(obj_result);
1771 goto exit_result_ok;
1776 exit_result_exception:
1777 return NUITKA_BOOL_EXCEPTION;
1780 return __BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(operand1, operand2);
1783nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1784 return _BINARY_OPERATION_MOD_NBOOL_OBJECT_LONG(operand1, operand2);
1788static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1,
1789 PyObject *operand2) {
1790 PyTypeObject *type2 = Py_TYPE(operand2);
1792#if defined(_MSC_VER)
1793#pragma warning(push)
1794#pragma warning(disable : 4101)
1796 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1797 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1798#if defined(_MSC_VER)
1802 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;
1803 binaryfunc slot2 = NULL;
1805 if (!(&PyLong_Type == type2)) {
1809 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
1811 if (slot1 == slot2) {
1816 if (slot1 != NULL) {
1817 if (slot2 != NULL) {
1818 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
1819 PyObject *x = slot2(operand1, operand2);
1821 if (x != Py_NotImplemented) {
1823 goto exit_binary_result_object;
1826 Py_DECREF_IMMORTAL(x);
1831 PyObject *x = slot1(operand1, operand2);
1833 if (x != Py_NotImplemented) {
1835 goto exit_binary_result_object;
1838 Py_DECREF_IMMORTAL(x);
1841 if (slot2 != NULL) {
1842 PyObject *x = slot2(operand1, operand2);
1844 if (x != Py_NotImplemented) {
1846 goto exit_binary_result_object;
1849 Py_DECREF_IMMORTAL(x);
1852#if PYTHON_VERSION < 0x300
1853 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1854 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
1857 PyObject *coerced1 = operand1;
1858 PyObject *coerced2 = operand2;
1860 int err = c1(&coerced1, &coerced2);
1862 if (unlikely(err < 0)) {
1863 goto exit_binary_exception;
1867 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1869 if (likely(mv == NULL)) {
1870 binaryfunc slot = mv->nb_remainder;
1872 if (likely(slot != NULL)) {
1873 PyObject *x = slot(coerced1, coerced2);
1875 Py_DECREF(coerced1);
1876 Py_DECREF(coerced2);
1879 goto exit_binary_result_object;
1884 Py_DECREF(coerced1);
1885 Py_DECREF(coerced2);
1889 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1892 PyObject *coerced1 = operand1;
1893 PyObject *coerced2 = operand2;
1895 int err = c2(&coerced2, &coerced1);
1897 if (unlikely(err < 0)) {
1898 goto exit_binary_exception;
1902 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1904 if (likely(mv == NULL)) {
1905 binaryfunc slot = mv->nb_remainder;
1907 if (likely(slot != NULL)) {
1908 PyObject *x = slot(coerced1, coerced2);
1910 Py_DECREF(coerced1);
1911 Py_DECREF(coerced2);
1914 goto exit_binary_result_object;
1919 Py_DECREF(coerced1);
1920 Py_DECREF(coerced2);
1926#if PYTHON_VERSION < 0x300
1927 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'long' and '%s'", type2->tp_name);
1929 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and '%s'", type2->tp_name);
1931 goto exit_binary_exception;
1933exit_binary_result_object:
1934 if (unlikely(obj_result == NULL)) {
1935 return NUITKA_BOOL_EXCEPTION;
1939 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1940 Py_DECREF(obj_result);
1944exit_binary_exception:
1945 return NUITKA_BOOL_EXCEPTION;
1947static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1948 CHECK_OBJECT(operand1);
1949 assert(PyLong_CheckExact(operand1));
1950 CHECK_OBJECT(operand2);
1952 PyTypeObject *type2 = Py_TYPE(operand2);
1954 if (&PyLong_Type == type2) {
1960#if defined(_MSC_VER)
1961#pragma warning(push)
1962#pragma warning(disable : 4101)
1964 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1965 NUITKA_MAY_BE_UNUSED
long clong_result;
1966#if defined(_MSC_VER)
1970 PyObject *x = PyLong_Type.tp_as_number->nb_remainder(operand1, operand2);
1971 assert(x != Py_NotImplemented);
1974 goto exit_result_object;
1977 if (unlikely(obj_result == NULL)) {
1978 goto exit_result_exception;
1980 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1981 Py_DECREF(obj_result);
1982 goto exit_result_ok;
1987 exit_result_exception:
1988 return NUITKA_BOOL_EXCEPTION;
1991 return __BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(operand1, operand2);
1994nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1995 return _BINARY_OPERATION_MOD_NBOOL_LONG_OBJECT(operand1, operand2);
1999static PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2000 CHECK_OBJECT(operand1);
2001 assert(PyFloat_CheckExact(operand1));
2002 CHECK_OBJECT(operand2);
2003 assert(PyFloat_CheckExact(operand2));
2007#if defined(_MSC_VER)
2008#pragma warning(push)
2009#pragma warning(disable : 4101)
2012 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2013 NUITKA_MAY_BE_UNUSED
long clong_result;
2014 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2015#if defined(_MSC_VER)
2019 CHECK_OBJECT(operand1);
2020 assert(PyFloat_CheckExact(operand1));
2021 CHECK_OBJECT(operand2);
2022 assert(PyFloat_CheckExact(operand2));
2024 const double a = PyFloat_AS_DOUBLE(operand1);
2025 const double b = PyFloat_AS_DOUBLE(operand2);
2027 if (unlikely(b == 0.0)) {
2028 PyThreadState *tstate = PyThreadState_GET();
2030 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
2031 goto exit_result_exception;
2035 double mod = fmod(a, b);
2037 if ((b < 0) != (mod < 0)) {
2041 mod = copysign(0.0, b);
2044 cfloat_result = mod;
2045 goto exit_result_ok_cfloat;
2048exit_result_ok_cfloat:
2049 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2050 goto exit_result_ok;
2055exit_result_exception:
2059PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2060 return _BINARY_OPERATION_MOD_OBJECT_FLOAT_FLOAT(operand1, operand2);
2064static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1,
2065 PyObject *operand2) {
2066 PyTypeObject *type1 = Py_TYPE(operand1);
2068#if defined(_MSC_VER)
2069#pragma warning(push)
2070#pragma warning(disable : 4101)
2072 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2073 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2074#if defined(_MSC_VER)
2079 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
2080 binaryfunc slot2 = NULL;
2082 if (!(type1 == &PyFloat_Type)) {
2085 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
2087 if (slot1 == slot2) {
2092 if (slot1 != NULL) {
2093 PyObject *x = slot1(operand1, operand2);
2095 if (x != Py_NotImplemented) {
2097 goto exit_binary_result_object;
2100 Py_DECREF_IMMORTAL(x);
2103 if (slot2 != NULL) {
2104 PyObject *x = slot2(operand1, operand2);
2106 if (x != Py_NotImplemented) {
2108 goto exit_binary_result_object;
2111 Py_DECREF_IMMORTAL(x);
2114#if PYTHON_VERSION < 0x300
2115 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
2117 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2120 PyObject *coerced1 = operand1;
2121 PyObject *coerced2 = operand2;
2123 int err = c1(&coerced1, &coerced2);
2125 if (unlikely(err < 0)) {
2126 goto exit_binary_exception;
2130 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2132 if (likely(mv == NULL)) {
2133 binaryfunc slot = mv->nb_remainder;
2135 if (likely(slot != NULL)) {
2136 PyObject *x = slot(coerced1, coerced2);
2138 Py_DECREF(coerced1);
2139 Py_DECREF(coerced2);
2142 goto exit_binary_result_object;
2147 Py_DECREF(coerced1);
2148 Py_DECREF(coerced2);
2151 coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
2154 PyObject *coerced1 = operand1;
2155 PyObject *coerced2 = operand2;
2157 int err = c2(&coerced2, &coerced1);
2159 if (unlikely(err < 0)) {
2160 goto exit_binary_exception;
2164 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2166 if (likely(mv == NULL)) {
2167 binaryfunc slot = mv->nb_remainder;
2169 if (likely(slot != NULL)) {
2170 PyObject *x = slot(coerced1, coerced2);
2172 Py_DECREF(coerced1);
2173 Py_DECREF(coerced2);
2176 goto exit_binary_result_object;
2181 Py_DECREF(coerced1);
2182 Py_DECREF(coerced2);
2188 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'float'", type1->tp_name);
2189 goto exit_binary_exception;
2191exit_binary_result_object:
2194exit_binary_exception:
2197static PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2198 CHECK_OBJECT(operand1);
2199 CHECK_OBJECT(operand2);
2200 assert(PyFloat_CheckExact(operand2));
2202 PyTypeObject *type1 = Py_TYPE(operand1);
2204 if (type1 == &PyFloat_Type) {
2209#if defined(_MSC_VER)
2210#pragma warning(push)
2211#pragma warning(disable : 4101)
2214 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2215 NUITKA_MAY_BE_UNUSED
long clong_result;
2216 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2217#if defined(_MSC_VER)
2221 CHECK_OBJECT(operand1);
2222 assert(PyFloat_CheckExact(operand1));
2223 CHECK_OBJECT(operand2);
2224 assert(PyFloat_CheckExact(operand2));
2226 const double a = PyFloat_AS_DOUBLE(operand1);
2227 const double b = PyFloat_AS_DOUBLE(operand2);
2229 if (unlikely(b == 0.0)) {
2230 PyThreadState *tstate = PyThreadState_GET();
2232 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
2233 goto exit_result_exception;
2237 double mod = fmod(a, b);
2239 if ((b < 0) != (mod < 0)) {
2243 mod = copysign(0.0, b);
2246 cfloat_result = mod;
2247 goto exit_result_ok_cfloat;
2250 exit_result_ok_cfloat:
2251 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2252 goto exit_result_ok;
2257 exit_result_exception:
2261 return __BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(operand1, operand2);
2264PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2265 return _BINARY_OPERATION_MOD_OBJECT_OBJECT_FLOAT(operand1, operand2);
2269static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1,
2270 PyObject *operand2) {
2271 PyTypeObject *type2 = Py_TYPE(operand2);
2273#if defined(_MSC_VER)
2274#pragma warning(push)
2275#pragma warning(disable : 4101)
2277 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2278 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2279#if defined(_MSC_VER)
2283 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;
2284 binaryfunc slot2 = NULL;
2286 if (!(&PyFloat_Type == type2)) {
2290 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
2292 if (slot1 == slot2) {
2297 if (slot1 != NULL) {
2298 if (slot2 != NULL) {
2299 if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
2300 PyObject *x = slot2(operand1, operand2);
2302 if (x != Py_NotImplemented) {
2304 goto exit_binary_result_object;
2307 Py_DECREF_IMMORTAL(x);
2312 PyObject *x = slot1(operand1, operand2);
2314 if (x != Py_NotImplemented) {
2316 goto exit_binary_result_object;
2319 Py_DECREF_IMMORTAL(x);
2322 if (slot2 != NULL) {
2323 PyObject *x = slot2(operand1, operand2);
2325 if (x != Py_NotImplemented) {
2327 goto exit_binary_result_object;
2330 Py_DECREF_IMMORTAL(x);
2333#if PYTHON_VERSION < 0x300
2334 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
2335 coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
2338 PyObject *coerced1 = operand1;
2339 PyObject *coerced2 = operand2;
2341 int err = c1(&coerced1, &coerced2);
2343 if (unlikely(err < 0)) {
2344 goto exit_binary_exception;
2348 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2350 if (likely(mv == NULL)) {
2351 binaryfunc slot = mv->nb_remainder;
2353 if (likely(slot != NULL)) {
2354 PyObject *x = slot(coerced1, coerced2);
2356 Py_DECREF(coerced1);
2357 Py_DECREF(coerced2);
2360 goto exit_binary_result_object;
2365 Py_DECREF(coerced1);
2366 Py_DECREF(coerced2);
2370 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2373 PyObject *coerced1 = operand1;
2374 PyObject *coerced2 = operand2;
2376 int err = c2(&coerced2, &coerced1);
2378 if (unlikely(err < 0)) {
2379 goto exit_binary_exception;
2383 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2385 if (likely(mv == NULL)) {
2386 binaryfunc slot = mv->nb_remainder;
2388 if (likely(slot != NULL)) {
2389 PyObject *x = slot(coerced1, coerced2);
2391 Py_DECREF(coerced1);
2392 Py_DECREF(coerced2);
2395 goto exit_binary_result_object;
2400 Py_DECREF(coerced1);
2401 Py_DECREF(coerced2);
2407 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and '%s'", type2->tp_name);
2408 goto exit_binary_exception;
2410exit_binary_result_object:
2413exit_binary_exception:
2416static PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2417 CHECK_OBJECT(operand1);
2418 assert(PyFloat_CheckExact(operand1));
2419 CHECK_OBJECT(operand2);
2421 PyTypeObject *type2 = Py_TYPE(operand2);
2423 if (&PyFloat_Type == type2) {
2428#if defined(_MSC_VER)
2429#pragma warning(push)
2430#pragma warning(disable : 4101)
2433 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2434 NUITKA_MAY_BE_UNUSED
long clong_result;
2435 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2436#if defined(_MSC_VER)
2440 CHECK_OBJECT(operand1);
2441 assert(PyFloat_CheckExact(operand1));
2442 CHECK_OBJECT(operand2);
2443 assert(PyFloat_CheckExact(operand2));
2445 const double a = PyFloat_AS_DOUBLE(operand1);
2446 const double b = PyFloat_AS_DOUBLE(operand2);
2448 if (unlikely(b == 0.0)) {
2449 PyThreadState *tstate = PyThreadState_GET();
2451 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
2452 goto exit_result_exception;
2456 double mod = fmod(a, b);
2458 if ((b < 0) != (mod < 0)) {
2462 mod = copysign(0.0, b);
2465 cfloat_result = mod;
2466 goto exit_result_ok_cfloat;
2469 exit_result_ok_cfloat:
2470 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2471 goto exit_result_ok;
2476 exit_result_exception:
2480 return __BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(operand1, operand2);
2483PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2484 return _BINARY_OPERATION_MOD_OBJECT_FLOAT_OBJECT(operand1, operand2);
2488static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2489 CHECK_OBJECT(operand1);
2490 assert(PyFloat_CheckExact(operand1));
2491 CHECK_OBJECT(operand2);
2492 assert(PyFloat_CheckExact(operand2));
2496#if defined(_MSC_VER)
2497#pragma warning(push)
2498#pragma warning(disable : 4101)
2501 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2502 NUITKA_MAY_BE_UNUSED
long clong_result;
2503 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2504#if defined(_MSC_VER)
2508 CHECK_OBJECT(operand1);
2509 assert(PyFloat_CheckExact(operand1));
2510 CHECK_OBJECT(operand2);
2511 assert(PyFloat_CheckExact(operand2));
2513 const double a = PyFloat_AS_DOUBLE(operand1);
2514 const double b = PyFloat_AS_DOUBLE(operand2);
2516 if (unlikely(b == 0.0)) {
2517 PyThreadState *tstate = PyThreadState_GET();
2519 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
2520 goto exit_result_exception;
2524 double mod = fmod(a, b);
2526 if ((b < 0) != (mod < 0)) {
2530 mod = copysign(0.0, b);
2533 cfloat_result = mod;
2534 goto exit_result_ok_cfloat;
2537exit_result_ok_cfloat:
2538 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2539 goto exit_result_ok;
2544exit_result_exception:
2545 return NUITKA_BOOL_EXCEPTION;
2548nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2549 return _BINARY_OPERATION_MOD_NBOOL_FLOAT_FLOAT(operand1, operand2);
2553static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1,
2554 PyObject *operand2) {
2555 PyTypeObject *type1 = Py_TYPE(operand1);
2557#if defined(_MSC_VER)
2558#pragma warning(push)
2559#pragma warning(disable : 4101)
2561 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2562 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2563#if defined(_MSC_VER)
2568 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
2569 binaryfunc slot2 = NULL;
2571 if (!(type1 == &PyFloat_Type)) {
2574 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
2576 if (slot1 == slot2) {
2581 if (slot1 != NULL) {
2582 PyObject *x = slot1(operand1, operand2);
2584 if (x != Py_NotImplemented) {
2586 goto exit_binary_result_object;
2589 Py_DECREF_IMMORTAL(x);
2592 if (slot2 != NULL) {
2593 PyObject *x = slot2(operand1, operand2);
2595 if (x != Py_NotImplemented) {
2597 goto exit_binary_result_object;
2600 Py_DECREF_IMMORTAL(x);
2603#if PYTHON_VERSION < 0x300
2604 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
2606 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2609 PyObject *coerced1 = operand1;
2610 PyObject *coerced2 = operand2;
2612 int err = c1(&coerced1, &coerced2);
2614 if (unlikely(err < 0)) {
2615 goto exit_binary_exception;
2619 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2621 if (likely(mv == NULL)) {
2622 binaryfunc slot = mv->nb_remainder;
2624 if (likely(slot != NULL)) {
2625 PyObject *x = slot(coerced1, coerced2);
2627 Py_DECREF(coerced1);
2628 Py_DECREF(coerced2);
2631 goto exit_binary_result_object;
2636 Py_DECREF(coerced1);
2637 Py_DECREF(coerced2);
2640 coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
2643 PyObject *coerced1 = operand1;
2644 PyObject *coerced2 = operand2;
2646 int err = c2(&coerced2, &coerced1);
2648 if (unlikely(err < 0)) {
2649 goto exit_binary_exception;
2653 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2655 if (likely(mv == NULL)) {
2656 binaryfunc slot = mv->nb_remainder;
2658 if (likely(slot != NULL)) {
2659 PyObject *x = slot(coerced1, coerced2);
2661 Py_DECREF(coerced1);
2662 Py_DECREF(coerced2);
2665 goto exit_binary_result_object;
2670 Py_DECREF(coerced1);
2671 Py_DECREF(coerced2);
2677 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and 'float'", type1->tp_name);
2678 goto exit_binary_exception;
2680exit_binary_result_object:
2681 if (unlikely(obj_result == NULL)) {
2682 return NUITKA_BOOL_EXCEPTION;
2686 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2687 Py_DECREF(obj_result);
2691exit_binary_exception:
2692 return NUITKA_BOOL_EXCEPTION;
2694static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2695 CHECK_OBJECT(operand1);
2696 CHECK_OBJECT(operand2);
2697 assert(PyFloat_CheckExact(operand2));
2699 PyTypeObject *type1 = Py_TYPE(operand1);
2701 if (type1 == &PyFloat_Type) {
2706#if defined(_MSC_VER)
2707#pragma warning(push)
2708#pragma warning(disable : 4101)
2711 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2712 NUITKA_MAY_BE_UNUSED
long clong_result;
2713 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2714#if defined(_MSC_VER)
2718 CHECK_OBJECT(operand1);
2719 assert(PyFloat_CheckExact(operand1));
2720 CHECK_OBJECT(operand2);
2721 assert(PyFloat_CheckExact(operand2));
2723 const double a = PyFloat_AS_DOUBLE(operand1);
2724 const double b = PyFloat_AS_DOUBLE(operand2);
2726 if (unlikely(b == 0.0)) {
2727 PyThreadState *tstate = PyThreadState_GET();
2729 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
2730 goto exit_result_exception;
2734 double mod = fmod(a, b);
2736 if ((b < 0) != (mod < 0)) {
2740 mod = copysign(0.0, b);
2743 cfloat_result = mod;
2744 goto exit_result_ok_cfloat;
2747 exit_result_ok_cfloat:
2748 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2749 goto exit_result_ok;
2754 exit_result_exception:
2755 return NUITKA_BOOL_EXCEPTION;
2758 return __BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(operand1, operand2);
2761nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2762 return _BINARY_OPERATION_MOD_NBOOL_OBJECT_FLOAT(operand1, operand2);
2766static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1,
2767 PyObject *operand2) {
2768 PyTypeObject *type2 = Py_TYPE(operand2);
2770#if defined(_MSC_VER)
2771#pragma warning(push)
2772#pragma warning(disable : 4101)
2774 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2775 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2776#if defined(_MSC_VER)
2780 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;
2781 binaryfunc slot2 = NULL;
2783 if (!(&PyFloat_Type == type2)) {
2787 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
2789 if (slot1 == slot2) {
2794 if (slot1 != NULL) {
2795 if (slot2 != NULL) {
2796 if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
2797 PyObject *x = slot2(operand1, operand2);
2799 if (x != Py_NotImplemented) {
2801 goto exit_binary_result_object;
2804 Py_DECREF_IMMORTAL(x);
2809 PyObject *x = slot1(operand1, operand2);
2811 if (x != Py_NotImplemented) {
2813 goto exit_binary_result_object;
2816 Py_DECREF_IMMORTAL(x);
2819 if (slot2 != NULL) {
2820 PyObject *x = slot2(operand1, operand2);
2822 if (x != Py_NotImplemented) {
2824 goto exit_binary_result_object;
2827 Py_DECREF_IMMORTAL(x);
2830#if PYTHON_VERSION < 0x300
2831 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
2832 coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
2835 PyObject *coerced1 = operand1;
2836 PyObject *coerced2 = operand2;
2838 int err = c1(&coerced1, &coerced2);
2840 if (unlikely(err < 0)) {
2841 goto exit_binary_exception;
2845 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2847 if (likely(mv == NULL)) {
2848 binaryfunc slot = mv->nb_remainder;
2850 if (likely(slot != NULL)) {
2851 PyObject *x = slot(coerced1, coerced2);
2853 Py_DECREF(coerced1);
2854 Py_DECREF(coerced2);
2857 goto exit_binary_result_object;
2862 Py_DECREF(coerced1);
2863 Py_DECREF(coerced2);
2867 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2870 PyObject *coerced1 = operand1;
2871 PyObject *coerced2 = operand2;
2873 int err = c2(&coerced2, &coerced1);
2875 if (unlikely(err < 0)) {
2876 goto exit_binary_exception;
2880 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2882 if (likely(mv == NULL)) {
2883 binaryfunc slot = mv->nb_remainder;
2885 if (likely(slot != NULL)) {
2886 PyObject *x = slot(coerced1, coerced2);
2888 Py_DECREF(coerced1);
2889 Py_DECREF(coerced2);
2892 goto exit_binary_result_object;
2897 Py_DECREF(coerced1);
2898 Py_DECREF(coerced2);
2904 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and '%s'", type2->tp_name);
2905 goto exit_binary_exception;
2907exit_binary_result_object:
2908 if (unlikely(obj_result == NULL)) {
2909 return NUITKA_BOOL_EXCEPTION;
2913 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2914 Py_DECREF(obj_result);
2918exit_binary_exception:
2919 return NUITKA_BOOL_EXCEPTION;
2921static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2922 CHECK_OBJECT(operand1);
2923 assert(PyFloat_CheckExact(operand1));
2924 CHECK_OBJECT(operand2);
2926 PyTypeObject *type2 = Py_TYPE(operand2);
2928 if (&PyFloat_Type == type2) {
2933#if defined(_MSC_VER)
2934#pragma warning(push)
2935#pragma warning(disable : 4101)
2938 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2939 NUITKA_MAY_BE_UNUSED
long clong_result;
2940 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2941#if defined(_MSC_VER)
2945 CHECK_OBJECT(operand1);
2946 assert(PyFloat_CheckExact(operand1));
2947 CHECK_OBJECT(operand2);
2948 assert(PyFloat_CheckExact(operand2));
2950 const double a = PyFloat_AS_DOUBLE(operand1);
2951 const double b = PyFloat_AS_DOUBLE(operand2);
2953 if (unlikely(b == 0.0)) {
2954 PyThreadState *tstate = PyThreadState_GET();
2956 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
2957 goto exit_result_exception;
2961 double mod = fmod(a, b);
2963 if ((b < 0) != (mod < 0)) {
2967 mod = copysign(0.0, b);
2970 cfloat_result = mod;
2971 goto exit_result_ok_cfloat;
2974 exit_result_ok_cfloat:
2975 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2976 goto exit_result_ok;
2981 exit_result_exception:
2982 return NUITKA_BOOL_EXCEPTION;
2985 return __BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(operand1, operand2);
2988nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2989 return _BINARY_OPERATION_MOD_NBOOL_FLOAT_OBJECT(operand1, operand2);
2993static PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
2994 CHECK_OBJECT(operand1);
2995 assert(PyFloat_CheckExact(operand1));
2996 CHECK_OBJECT(operand2);
2997 assert(PyLong_CheckExact(operand2));
2999#if defined(_MSC_VER)
3000#pragma warning(push)
3001#pragma warning(disable : 4101)
3003 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3004 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3005#if defined(_MSC_VER)
3009 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;
3012 if (slot1 != NULL) {
3013 PyObject *x = slot1(operand1, operand2);
3015 if (x != Py_NotImplemented) {
3017 goto exit_binary_result_object;
3020 Py_DECREF_IMMORTAL(x);
3025#if PYTHON_VERSION < 0x300
3026 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and 'long'");
3028 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and 'int'");
3030 goto exit_binary_exception;
3032exit_binary_result_object:
3035exit_binary_exception:
3039PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3040 return _BINARY_OPERATION_MOD_OBJECT_FLOAT_LONG(operand1, operand2);
3044static PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
3045 CHECK_OBJECT(operand1);
3046 assert(PyLong_CheckExact(operand1));
3047 CHECK_OBJECT(operand2);
3048 assert(PyFloat_CheckExact(operand2));
3050#if defined(_MSC_VER)
3051#pragma warning(push)
3052#pragma warning(disable : 4101)
3054 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3055 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3056#if defined(_MSC_VER)
3061 binaryfunc slot2 = NULL;
3066 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
3069 if (slot2 != NULL) {
3070 PyObject *x = slot2(operand1, operand2);
3072 if (x != Py_NotImplemented) {
3074 goto exit_binary_result_object;
3077 Py_DECREF_IMMORTAL(x);
3082#if PYTHON_VERSION < 0x300
3083 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'long' and 'float'");
3085 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and 'float'");
3087 goto exit_binary_exception;
3089exit_binary_result_object:
3092exit_binary_exception:
3096PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
3097 return _BINARY_OPERATION_MOD_OBJECT_LONG_FLOAT(operand1, operand2);
3101static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3102 CHECK_OBJECT(operand1);
3103 assert(PyFloat_CheckExact(operand1));
3104 CHECK_OBJECT(operand2);
3105 assert(PyLong_CheckExact(operand2));
3107#if defined(_MSC_VER)
3108#pragma warning(push)
3109#pragma warning(disable : 4101)
3111 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3112 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3113#if defined(_MSC_VER)
3117 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;
3120 if (slot1 != NULL) {
3121 PyObject *x = slot1(operand1, operand2);
3123 if (x != Py_NotImplemented) {
3125 goto exit_binary_result_object;
3128 Py_DECREF_IMMORTAL(x);
3133#if PYTHON_VERSION < 0x300
3134 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and 'long'");
3136 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and 'int'");
3138 goto exit_binary_exception;
3140exit_binary_result_object:
3141 if (unlikely(obj_result == NULL)) {
3142 return NUITKA_BOOL_EXCEPTION;
3146 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3147 Py_DECREF(obj_result);
3151exit_binary_exception:
3152 return NUITKA_BOOL_EXCEPTION;
3155nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3156 return _BINARY_OPERATION_MOD_NBOOL_FLOAT_LONG(operand1, operand2);
3160static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
3161 CHECK_OBJECT(operand1);
3162 assert(PyLong_CheckExact(operand1));
3163 CHECK_OBJECT(operand2);
3164 assert(PyFloat_CheckExact(operand2));
3166#if defined(_MSC_VER)
3167#pragma warning(push)
3168#pragma warning(disable : 4101)
3170 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3171 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3172#if defined(_MSC_VER)
3177 binaryfunc slot2 = NULL;
3182 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
3185 if (slot2 != NULL) {
3186 PyObject *x = slot2(operand1, operand2);
3188 if (x != Py_NotImplemented) {
3190 goto exit_binary_result_object;
3193 Py_DECREF_IMMORTAL(x);
3198#if PYTHON_VERSION < 0x300
3199 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'long' and 'float'");
3201 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and 'float'");
3203 goto exit_binary_exception;
3205exit_binary_result_object:
3206 if (unlikely(obj_result == NULL)) {
3207 return NUITKA_BOOL_EXCEPTION;
3211 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3212 Py_DECREF(obj_result);
3216exit_binary_exception:
3217 return NUITKA_BOOL_EXCEPTION;
3220nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
3221 return _BINARY_OPERATION_MOD_NBOOL_LONG_FLOAT(operand1, operand2);
3224#if PYTHON_VERSION < 0x300
3226static PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3227 CHECK_OBJECT(operand1);
3228 assert(PyFloat_CheckExact(operand1));
3229 CHECK_OBJECT(operand2);
3230 assert(PyInt_CheckExact(operand2));
3232#if defined(_MSC_VER)
3233#pragma warning(push)
3234#pragma warning(disable : 4101)
3236 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3237 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3238#if defined(_MSC_VER)
3242 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;
3245 if (slot1 != NULL) {
3246 PyObject *x = slot1(operand1, operand2);
3248 if (x != Py_NotImplemented) {
3250 goto exit_binary_result_object;
3253 Py_DECREF_IMMORTAL(x);
3258 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and 'int'");
3259 goto exit_binary_exception;
3261exit_binary_result_object:
3264exit_binary_exception:
3268PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3269 return _BINARY_OPERATION_MOD_OBJECT_FLOAT_INT(operand1, operand2);
3273#if PYTHON_VERSION < 0x300
3275static PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
3276 CHECK_OBJECT(operand1);
3277 assert(PyInt_CheckExact(operand1));
3278 CHECK_OBJECT(operand2);
3279 assert(PyFloat_CheckExact(operand2));
3281#if defined(_MSC_VER)
3282#pragma warning(push)
3283#pragma warning(disable : 4101)
3285 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3286 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3287#if defined(_MSC_VER)
3292 binaryfunc slot2 = NULL;
3297 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
3300 if (slot2 != NULL) {
3301 PyObject *x = slot2(operand1, operand2);
3303 if (x != Py_NotImplemented) {
3305 goto exit_binary_result_object;
3308 Py_DECREF_IMMORTAL(x);
3313 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and 'float'");
3314 goto exit_binary_exception;
3316exit_binary_result_object:
3319exit_binary_exception:
3323PyObject *BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
3324 return _BINARY_OPERATION_MOD_OBJECT_INT_FLOAT(operand1, operand2);
3328#if PYTHON_VERSION < 0x300
3330static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3331 CHECK_OBJECT(operand1);
3332 assert(PyFloat_CheckExact(operand1));
3333 CHECK_OBJECT(operand2);
3334 assert(PyInt_CheckExact(operand2));
3336#if defined(_MSC_VER)
3337#pragma warning(push)
3338#pragma warning(disable : 4101)
3340 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3341 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3342#if defined(_MSC_VER)
3346 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_remainder;
3349 if (slot1 != NULL) {
3350 PyObject *x = slot1(operand1, operand2);
3352 if (x != Py_NotImplemented) {
3354 goto exit_binary_result_object;
3357 Py_DECREF_IMMORTAL(x);
3362 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'float' and 'int'");
3363 goto exit_binary_exception;
3365exit_binary_result_object:
3366 if (unlikely(obj_result == NULL)) {
3367 return NUITKA_BOOL_EXCEPTION;
3371 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3372 Py_DECREF(obj_result);
3376exit_binary_exception:
3377 return NUITKA_BOOL_EXCEPTION;
3380nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3381 return _BINARY_OPERATION_MOD_NBOOL_FLOAT_INT(operand1, operand2);
3385#if PYTHON_VERSION < 0x300
3387static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
3388 CHECK_OBJECT(operand1);
3389 assert(PyInt_CheckExact(operand1));
3390 CHECK_OBJECT(operand2);
3391 assert(PyFloat_CheckExact(operand2));
3393#if defined(_MSC_VER)
3394#pragma warning(push)
3395#pragma warning(disable : 4101)
3397 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3398 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3399#if defined(_MSC_VER)
3404 binaryfunc slot2 = NULL;
3409 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
3412 if (slot2 != NULL) {
3413 PyObject *x = slot2(operand1, operand2);
3415 if (x != Py_NotImplemented) {
3417 goto exit_binary_result_object;
3420 Py_DECREF_IMMORTAL(x);
3425 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and 'float'");
3426 goto exit_binary_exception;
3428exit_binary_result_object:
3429 if (unlikely(obj_result == NULL)) {
3430 return NUITKA_BOOL_EXCEPTION;
3434 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3435 Py_DECREF(obj_result);
3439exit_binary_exception:
3440 return NUITKA_BOOL_EXCEPTION;
3443nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
3444 return _BINARY_OPERATION_MOD_NBOOL_INT_FLOAT(operand1, operand2);
3448#if PYTHON_VERSION < 0x300
3450static PyObject *_BINARY_OPERATION_MOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
3451 CHECK_OBJECT(operand1);
3452 assert(PyLong_CheckExact(operand1));
3453 CHECK_OBJECT(operand2);
3454 assert(PyInt_CheckExact(operand2));
3456#if defined(_MSC_VER)
3457#pragma warning(push)
3458#pragma warning(disable : 4101)
3460 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3461 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3462#if defined(_MSC_VER)
3466 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;
3469 if (slot1 != NULL) {
3470 PyObject *x = slot1(operand1, operand2);
3472 if (x != Py_NotImplemented) {
3474 goto exit_binary_result_object;
3477 Py_DECREF_IMMORTAL(x);
3482 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'long' and 'int'");
3483 goto exit_binary_exception;
3485exit_binary_result_object:
3488exit_binary_exception:
3492PyObject *BINARY_OPERATION_MOD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
3493 return _BINARY_OPERATION_MOD_OBJECT_LONG_INT(operand1, operand2);
3497#if PYTHON_VERSION < 0x300
3499static PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {
3500 CHECK_OBJECT(operand1);
3501 assert(PyInt_CheckExact(operand1));
3502 CHECK_OBJECT(operand2);
3503 assert(PyLong_CheckExact(operand2));
3505#if defined(_MSC_VER)
3506#pragma warning(push)
3507#pragma warning(disable : 4101)
3509 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3510 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3511#if defined(_MSC_VER)
3516 binaryfunc slot2 = NULL;
3521 slot2 = PyLong_Type.tp_as_number->nb_remainder;
3524 if (slot2 != NULL) {
3525 PyObject *x = slot2(operand1, operand2);
3527 if (x != Py_NotImplemented) {
3529 goto exit_binary_result_object;
3532 Py_DECREF_IMMORTAL(x);
3537 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and 'long'");
3538 goto exit_binary_exception;
3540exit_binary_result_object:
3543exit_binary_exception:
3547PyObject *BINARY_OPERATION_MOD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {
3548 return _BINARY_OPERATION_MOD_OBJECT_INT_LONG(operand1, operand2);
3552#if PYTHON_VERSION < 0x300
3554static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
3555 CHECK_OBJECT(operand1);
3556 assert(PyLong_CheckExact(operand1));
3557 CHECK_OBJECT(operand2);
3558 assert(PyInt_CheckExact(operand2));
3560#if defined(_MSC_VER)
3561#pragma warning(push)
3562#pragma warning(disable : 4101)
3564 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3565 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3566#if defined(_MSC_VER)
3570 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_remainder;
3573 if (slot1 != NULL) {
3574 PyObject *x = slot1(operand1, operand2);
3576 if (x != Py_NotImplemented) {
3578 goto exit_binary_result_object;
3581 Py_DECREF_IMMORTAL(x);
3586 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'long' and 'int'");
3587 goto exit_binary_exception;
3589exit_binary_result_object:
3590 if (unlikely(obj_result == NULL)) {
3591 return NUITKA_BOOL_EXCEPTION;
3595 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3596 Py_DECREF(obj_result);
3600exit_binary_exception:
3601 return NUITKA_BOOL_EXCEPTION;
3604nuitka_bool BINARY_OPERATION_MOD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
3605 return _BINARY_OPERATION_MOD_NBOOL_LONG_INT(operand1, operand2);
3609#if PYTHON_VERSION < 0x300
3611static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {
3612 CHECK_OBJECT(operand1);
3613 assert(PyInt_CheckExact(operand1));
3614 CHECK_OBJECT(operand2);
3615 assert(PyLong_CheckExact(operand2));
3617#if defined(_MSC_VER)
3618#pragma warning(push)
3619#pragma warning(disable : 4101)
3621 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3622 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3623#if defined(_MSC_VER)
3628 binaryfunc slot2 = NULL;
3633 slot2 = PyLong_Type.tp_as_number->nb_remainder;
3636 if (slot2 != NULL) {
3637 PyObject *x = slot2(operand1, operand2);
3639 if (x != Py_NotImplemented) {
3641 goto exit_binary_result_object;
3644 Py_DECREF_IMMORTAL(x);
3649 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'int' and 'long'");
3650 goto exit_binary_exception;
3652exit_binary_result_object:
3653 if (unlikely(obj_result == NULL)) {
3654 return NUITKA_BOOL_EXCEPTION;
3658 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3659 Py_DECREF(obj_result);
3663exit_binary_exception:
3664 return NUITKA_BOOL_EXCEPTION;
3667nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2) {
3668 return _BINARY_OPERATION_MOD_NBOOL_INT_LONG(operand1, operand2);
3672#if PYTHON_VERSION < 0x300
3674static PyObject *_BINARY_OPERATION_MOD_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
3675 CHECK_OBJECT(operand1);
3676 assert(PyInt_CheckExact(operand1));
3681#if defined(_MSC_VER)
3682#pragma warning(push)
3683#pragma warning(disable : 4101)
3685 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3686 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3687 NUITKA_MAY_BE_UNUSED
long clong_result;
3688 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3689#if defined(_MSC_VER)
3693 CHECK_OBJECT(operand1);
3694 assert(PyInt_CheckExact(operand1));
3696 const long a = PyInt_AS_LONG(operand1);
3697 const long b = operand2;
3705 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
3709 if (r != 0 && ((b ^ r) < 0)) {
3714 goto exit_result_ok_clong;
3718 PyObject *operand1_object = operand1;
3719 PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
3721 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
3722 assert(r != Py_NotImplemented);
3724 Py_DECREF(operand2_object);
3727 goto exit_result_object;
3730exit_result_ok_clong:
3731 result = Nuitka_PyInt_FromLong(clong_result);
3732 goto exit_result_ok;
3735 if (unlikely(obj_result == NULL)) {
3736 goto exit_result_exception;
3738 result = obj_result;
3739 goto exit_result_ok;
3744exit_result_exception:
3748PyObject *BINARY_OPERATION_MOD_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
3749 return _BINARY_OPERATION_MOD_OBJECT_INT_CLONG(operand1, operand2);
3753#if PYTHON_VERSION < 0x300
3755static PyObject *_BINARY_OPERATION_MOD_OBJECT_CLONG_INT(
long operand1, PyObject *operand2) {
3757 CHECK_OBJECT(operand2);
3758 assert(PyInt_CheckExact(operand2));
3763#if defined(_MSC_VER)
3764#pragma warning(push)
3765#pragma warning(disable : 4101)
3767 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3768 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3769 NUITKA_MAY_BE_UNUSED
long clong_result;
3770 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3771#if defined(_MSC_VER)
3775 CHECK_OBJECT(operand2);
3776 assert(PyInt_CheckExact(operand2));
3778 const long a = operand1;
3779 const long b = PyInt_AS_LONG(operand2);
3787 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
3791 if (r != 0 && ((b ^ r) < 0)) {
3796 goto exit_result_ok_clong;
3800 PyObject *operand1_object = Nuitka_PyLong_FromLong(operand1);
3801 PyObject *operand2_object = operand2;
3803 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
3804 assert(r != Py_NotImplemented);
3806 Py_DECREF(operand1_object);
3809 goto exit_result_object;
3812exit_result_ok_clong:
3813 result = Nuitka_PyInt_FromLong(clong_result);
3814 goto exit_result_ok;
3817 if (unlikely(obj_result == NULL)) {
3818 goto exit_result_exception;
3820 result = obj_result;
3821 goto exit_result_ok;
3826exit_result_exception:
3830PyObject *BINARY_OPERATION_MOD_OBJECT_CLONG_INT(
long operand1, PyObject *operand2) {
3831 return _BINARY_OPERATION_MOD_OBJECT_CLONG_INT(operand1, operand2);
3835#if PYTHON_VERSION < 0x300
3837static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_INT_CLONG(PyObject *operand1,
long operand2) {
3838 CHECK_OBJECT(operand1);
3839 assert(PyInt_CheckExact(operand1));
3844#if defined(_MSC_VER)
3845#pragma warning(push)
3846#pragma warning(disable : 4101)
3848 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3849 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3850 NUITKA_MAY_BE_UNUSED
long clong_result;
3851 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3852#if defined(_MSC_VER)
3856 CHECK_OBJECT(operand1);
3857 assert(PyInt_CheckExact(operand1));
3859 const long a = PyInt_AS_LONG(operand1);
3860 const long b = operand2;
3868 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
3872 if (r != 0 && ((b ^ r) < 0)) {
3877 goto exit_result_ok_clong;
3881 PyObject *operand1_object = operand1;
3882 PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
3884 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
3885 assert(r != Py_NotImplemented);
3887 Py_DECREF(operand2_object);
3890 goto exit_result_object;
3893exit_result_ok_clong:
3894 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3895 goto exit_result_ok;
3898 if (unlikely(obj_result == NULL)) {
3899 goto exit_result_exception;
3901 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3902 Py_DECREF(obj_result);
3903 goto exit_result_ok;
3908exit_result_exception:
3909 return NUITKA_BOOL_EXCEPTION;
3912nuitka_bool BINARY_OPERATION_MOD_NBOOL_INT_CLONG(PyObject *operand1,
long operand2) {
3913 return _BINARY_OPERATION_MOD_NBOOL_INT_CLONG(operand1, operand2);
3917#if PYTHON_VERSION < 0x300
3919static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_CLONG_INT(
long operand1, PyObject *operand2) {
3921 CHECK_OBJECT(operand2);
3922 assert(PyInt_CheckExact(operand2));
3927#if defined(_MSC_VER)
3928#pragma warning(push)
3929#pragma warning(disable : 4101)
3931 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3932 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3933 NUITKA_MAY_BE_UNUSED
long clong_result;
3934 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3935#if defined(_MSC_VER)
3939 CHECK_OBJECT(operand2);
3940 assert(PyInt_CheckExact(operand2));
3942 const long a = operand1;
3943 const long b = PyInt_AS_LONG(operand2);
3951 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
3955 if (r != 0 && ((b ^ r) < 0)) {
3960 goto exit_result_ok_clong;
3964 PyObject *operand1_object = Nuitka_PyLong_FromLong(operand1);
3965 PyObject *operand2_object = operand2;
3967 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
3968 assert(r != Py_NotImplemented);
3970 Py_DECREF(operand1_object);
3973 goto exit_result_object;
3976exit_result_ok_clong:
3977 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3978 goto exit_result_ok;
3981 if (unlikely(obj_result == NULL)) {
3982 goto exit_result_exception;
3984 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3985 Py_DECREF(obj_result);
3986 goto exit_result_ok;
3991exit_result_exception:
3992 return NUITKA_BOOL_EXCEPTION;
3995nuitka_bool BINARY_OPERATION_MOD_NBOOL_CLONG_INT(
long operand1, PyObject *operand2) {
3996 return _BINARY_OPERATION_MOD_NBOOL_CLONG_INT(operand1, operand2);
4001static PyObject *_BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
4002 CHECK_OBJECT(operand1);
4003 assert(PyFloat_CheckExact(operand1));
4007#if defined(_MSC_VER)
4008#pragma warning(push)
4009#pragma warning(disable : 4101)
4012 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4013 NUITKA_MAY_BE_UNUSED
long clong_result;
4014 NUITKA_MAY_BE_UNUSED
double cfloat_result;
4015#if defined(_MSC_VER)
4019 CHECK_OBJECT(operand1);
4020 assert(PyFloat_CheckExact(operand1));
4022 const double a = PyFloat_AS_DOUBLE(operand1);
4023 const double b = operand2;
4025 if (unlikely(b == 0.0)) {
4026 PyThreadState *tstate = PyThreadState_GET();
4028 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
4029 goto exit_result_exception;
4033 double mod = fmod(a, b);
4035 if ((b < 0) != (mod < 0)) {
4039 mod = copysign(0.0, b);
4042 cfloat_result = mod;
4043 goto exit_result_ok_cfloat;
4046exit_result_ok_cfloat:
4047 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
4048 goto exit_result_ok;
4053exit_result_exception:
4057PyObject *BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
4058 return _BINARY_OPERATION_MOD_OBJECT_FLOAT_CFLOAT(operand1, operand2);
4062static PyObject *_BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(
double operand1, PyObject *operand2) {
4064 CHECK_OBJECT(operand2);
4065 assert(PyFloat_CheckExact(operand2));
4069#if defined(_MSC_VER)
4070#pragma warning(push)
4071#pragma warning(disable : 4101)
4074 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4075 NUITKA_MAY_BE_UNUSED
long clong_result;
4076 NUITKA_MAY_BE_UNUSED
double cfloat_result;
4077#if defined(_MSC_VER)
4081 CHECK_OBJECT(operand2);
4082 assert(PyFloat_CheckExact(operand2));
4084 const double a = operand1;
4085 const double b = PyFloat_AS_DOUBLE(operand2);
4087 if (unlikely(b == 0.0)) {
4088 PyThreadState *tstate = PyThreadState_GET();
4090 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
4091 goto exit_result_exception;
4095 double mod = fmod(a, b);
4097 if ((b < 0) != (mod < 0)) {
4101 mod = copysign(0.0, b);
4104 cfloat_result = mod;
4105 goto exit_result_ok_cfloat;
4108exit_result_ok_cfloat:
4109 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
4110 goto exit_result_ok;
4115exit_result_exception:
4119PyObject *BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(
double operand1, PyObject *operand2) {
4120 return _BINARY_OPERATION_MOD_OBJECT_CFLOAT_FLOAT(operand1, operand2);
4124static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
4125 CHECK_OBJECT(operand1);
4126 assert(PyFloat_CheckExact(operand1));
4130#if defined(_MSC_VER)
4131#pragma warning(push)
4132#pragma warning(disable : 4101)
4135 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4136 NUITKA_MAY_BE_UNUSED
long clong_result;
4137 NUITKA_MAY_BE_UNUSED
double cfloat_result;
4138#if defined(_MSC_VER)
4142 CHECK_OBJECT(operand1);
4143 assert(PyFloat_CheckExact(operand1));
4145 const double a = PyFloat_AS_DOUBLE(operand1);
4146 const double b = operand2;
4148 if (unlikely(b == 0.0)) {
4149 PyThreadState *tstate = PyThreadState_GET();
4151 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
4152 goto exit_result_exception;
4156 double mod = fmod(a, b);
4158 if ((b < 0) != (mod < 0)) {
4162 mod = copysign(0.0, b);
4165 cfloat_result = mod;
4166 goto exit_result_ok_cfloat;
4169exit_result_ok_cfloat:
4170 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
4171 goto exit_result_ok;
4176exit_result_exception:
4177 return NUITKA_BOOL_EXCEPTION;
4180nuitka_bool BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
4181 return _BINARY_OPERATION_MOD_NBOOL_FLOAT_CFLOAT(operand1, operand2);
4185static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(
double operand1, PyObject *operand2) {
4187 CHECK_OBJECT(operand2);
4188 assert(PyFloat_CheckExact(operand2));
4192#if defined(_MSC_VER)
4193#pragma warning(push)
4194#pragma warning(disable : 4101)
4197 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4198 NUITKA_MAY_BE_UNUSED
long clong_result;
4199 NUITKA_MAY_BE_UNUSED
double cfloat_result;
4200#if defined(_MSC_VER)
4204 CHECK_OBJECT(operand2);
4205 assert(PyFloat_CheckExact(operand2));
4207 const double a = operand1;
4208 const double b = PyFloat_AS_DOUBLE(operand2);
4210 if (unlikely(b == 0.0)) {
4211 PyThreadState *tstate = PyThreadState_GET();
4213 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float modulo");
4214 goto exit_result_exception;
4218 double mod = fmod(a, b);
4220 if ((b < 0) != (mod < 0)) {
4224 mod = copysign(0.0, b);
4227 cfloat_result = mod;
4228 goto exit_result_ok_cfloat;
4231exit_result_ok_cfloat:
4232 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
4233 goto exit_result_ok;
4238exit_result_exception:
4239 return NUITKA_BOOL_EXCEPTION;
4242nuitka_bool BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(
double operand1, PyObject *operand2) {
4243 return _BINARY_OPERATION_MOD_NBOOL_CFLOAT_FLOAT(operand1, operand2);
4246#if PYTHON_VERSION < 0x300
4248static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {
4249 CHECK_OBJECT(operand1);
4250 assert(PyString_CheckExact(operand1));
4251 CHECK_OBJECT(operand2);
4252 assert(PyInt_CheckExact(operand2));
4254#if defined(_MSC_VER)
4255#pragma warning(push)
4256#pragma warning(disable : 4101)
4258 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4259 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4260#if defined(_MSC_VER)
4264 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4265 binaryfunc slot2 = NULL;
4270 slot2 = PyInt_Type.tp_as_number->nb_remainder;
4273 if (slot1 != NULL) {
4274 PyObject *x = slot1(operand1, operand2);
4276 if (x != Py_NotImplemented) {
4278 goto exit_binary_result_object;
4281 Py_DECREF_IMMORTAL(x);
4284 if (slot2 != NULL) {
4285 PyObject *x = slot2(operand1, operand2);
4287 if (x != Py_NotImplemented) {
4289 goto exit_binary_result_object;
4292 Py_DECREF_IMMORTAL(x);
4297 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'int'");
4298 goto exit_binary_exception;
4300exit_binary_result_object:
4303exit_binary_exception:
4307PyObject *BINARY_OPERATION_MOD_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {
4308 return _BINARY_OPERATION_MOD_OBJECT_STR_INT(operand1, operand2);
4312#if PYTHON_VERSION < 0x300
4314static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_LONG(PyObject *operand1, PyObject *operand2) {
4315 CHECK_OBJECT(operand1);
4316 assert(PyString_CheckExact(operand1));
4317 CHECK_OBJECT(operand2);
4318 assert(PyLong_CheckExact(operand2));
4320#if defined(_MSC_VER)
4321#pragma warning(push)
4322#pragma warning(disable : 4101)
4324 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4325 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4326#if defined(_MSC_VER)
4330 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4331 binaryfunc slot2 = NULL;
4336 slot2 = PyLong_Type.tp_as_number->nb_remainder;
4339 if (slot1 != NULL) {
4340 PyObject *x = slot1(operand1, operand2);
4342 if (x != Py_NotImplemented) {
4344 goto exit_binary_result_object;
4347 Py_DECREF_IMMORTAL(x);
4350 if (slot2 != NULL) {
4351 PyObject *x = slot2(operand1, operand2);
4353 if (x != Py_NotImplemented) {
4355 goto exit_binary_result_object;
4358 Py_DECREF_IMMORTAL(x);
4363 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'long'");
4364 goto exit_binary_exception;
4366exit_binary_result_object:
4369exit_binary_exception:
4373PyObject *BINARY_OPERATION_MOD_OBJECT_STR_LONG(PyObject *operand1, PyObject *operand2) {
4374 return _BINARY_OPERATION_MOD_OBJECT_STR_LONG(operand1, operand2);
4378#if PYTHON_VERSION < 0x300
4380static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(PyObject *operand1, PyObject *operand2) {
4381 CHECK_OBJECT(operand1);
4382 assert(PyString_CheckExact(operand1));
4383 CHECK_OBJECT(operand2);
4384 assert(PyFloat_CheckExact(operand2));
4386#if defined(_MSC_VER)
4387#pragma warning(push)
4388#pragma warning(disable : 4101)
4390 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4391 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4392#if defined(_MSC_VER)
4396 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4397 binaryfunc slot2 = NULL;
4402 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
4405 if (slot1 != NULL) {
4406 PyObject *x = slot1(operand1, operand2);
4408 if (x != Py_NotImplemented) {
4410 goto exit_binary_result_object;
4413 Py_DECREF_IMMORTAL(x);
4416 if (slot2 != NULL) {
4417 PyObject *x = slot2(operand1, operand2);
4419 if (x != Py_NotImplemented) {
4421 goto exit_binary_result_object;
4424 Py_DECREF_IMMORTAL(x);
4429 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'float'");
4430 goto exit_binary_exception;
4432exit_binary_result_object:
4435exit_binary_exception:
4439PyObject *BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(PyObject *operand1, PyObject *operand2) {
4440 return _BINARY_OPERATION_MOD_OBJECT_STR_FLOAT(operand1, operand2);
4444#if PYTHON_VERSION < 0x300
4446static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {
4447 CHECK_OBJECT(operand1);
4448 assert(PyString_CheckExact(operand1));
4449 CHECK_OBJECT(operand2);
4450 assert(PyString_CheckExact(operand2));
4455 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4457 PyObject *x = PyString_Format(operand1, operand2);
4460 goto exit_result_object;
4463 if (unlikely(obj_result == NULL)) {
4464 goto exit_result_exception;
4466 result = obj_result;
4467 goto exit_result_ok;
4472exit_result_exception:
4476PyObject *BINARY_OPERATION_MOD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2) {
4477 return _BINARY_OPERATION_MOD_OBJECT_STR_STR(operand1, operand2);
4481#if PYTHON_VERSION < 0x300
4483static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2) {
4484 CHECK_OBJECT(operand1);
4485 assert(PyString_CheckExact(operand1));
4486 CHECK_OBJECT(operand2);
4487 assert(PyUnicode_CheckExact(operand2));
4489#if defined(_MSC_VER)
4490#pragma warning(push)
4491#pragma warning(disable : 4101)
4493 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4494 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4495#if defined(_MSC_VER)
4499 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4500 binaryfunc slot2 = NULL;
4505 slot2 = PyUnicode_Type.tp_as_number->nb_remainder;
4508 if (slot1 != NULL) {
4509 PyObject *x = slot1(operand1, operand2);
4511 if (x != Py_NotImplemented) {
4513 goto exit_binary_result_object;
4516 Py_DECREF_IMMORTAL(x);
4519 if (slot2 != NULL) {
4520 PyObject *x = slot2(operand1, operand2);
4522 if (x != Py_NotImplemented) {
4524 goto exit_binary_result_object;
4527 Py_DECREF_IMMORTAL(x);
4532 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'unicode'");
4533 goto exit_binary_exception;
4535exit_binary_result_object:
4538exit_binary_exception:
4542PyObject *BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2) {
4543 return _BINARY_OPERATION_MOD_OBJECT_STR_UNICODE(operand1, operand2);
4547#if PYTHON_VERSION < 0x300
4549static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(PyObject *operand1, PyObject *operand2) {
4550 CHECK_OBJECT(operand1);
4551 assert(PyString_CheckExact(operand1));
4552 CHECK_OBJECT(operand2);
4553 assert(PyTuple_CheckExact(operand2));
4555#if defined(_MSC_VER)
4556#pragma warning(push)
4557#pragma warning(disable : 4101)
4559 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4560 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4561#if defined(_MSC_VER)
4565 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4567 if (slot1 != NULL) {
4568 PyObject *x = slot1(operand1, operand2);
4570 if (x != Py_NotImplemented) {
4572 goto exit_binary_result_object;
4575 Py_DECREF_IMMORTAL(x);
4580 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'tuple'");
4581 goto exit_binary_exception;
4583exit_binary_result_object:
4586exit_binary_exception:
4590PyObject *BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(PyObject *operand1, PyObject *operand2) {
4591 return _BINARY_OPERATION_MOD_OBJECT_STR_TUPLE(operand1, operand2);
4595#if PYTHON_VERSION < 0x300
4597static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_LIST(PyObject *operand1, PyObject *operand2) {
4598 CHECK_OBJECT(operand1);
4599 assert(PyString_CheckExact(operand1));
4600 CHECK_OBJECT(operand2);
4601 assert(PyList_CheckExact(operand2));
4603#if defined(_MSC_VER)
4604#pragma warning(push)
4605#pragma warning(disable : 4101)
4607 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4608 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4609#if defined(_MSC_VER)
4613 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4615 if (slot1 != NULL) {
4616 PyObject *x = slot1(operand1, operand2);
4618 if (x != Py_NotImplemented) {
4620 goto exit_binary_result_object;
4623 Py_DECREF_IMMORTAL(x);
4628 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'list'");
4629 goto exit_binary_exception;
4631exit_binary_result_object:
4634exit_binary_exception:
4638PyObject *BINARY_OPERATION_MOD_OBJECT_STR_LIST(PyObject *operand1, PyObject *operand2) {
4639 return _BINARY_OPERATION_MOD_OBJECT_STR_LIST(operand1, operand2);
4643#if PYTHON_VERSION < 0x300
4645static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_DICT(PyObject *operand1, PyObject *operand2) {
4646 CHECK_OBJECT(operand1);
4647 assert(PyString_CheckExact(operand1));
4648 CHECK_OBJECT(operand2);
4649 assert(PyDict_CheckExact(operand2));
4651#if defined(_MSC_VER)
4652#pragma warning(push)
4653#pragma warning(disable : 4101)
4655 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4656 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4657#if defined(_MSC_VER)
4661 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4663 if (slot1 != NULL) {
4664 PyObject *x = slot1(operand1, operand2);
4666 if (x != Py_NotImplemented) {
4668 goto exit_binary_result_object;
4671 Py_DECREF_IMMORTAL(x);
4676 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'dict'");
4677 goto exit_binary_exception;
4679exit_binary_result_object:
4682exit_binary_exception:
4686PyObject *BINARY_OPERATION_MOD_OBJECT_STR_DICT(PyObject *operand1, PyObject *operand2) {
4687 return _BINARY_OPERATION_MOD_OBJECT_STR_DICT(operand1, operand2);
4691#if PYTHON_VERSION < 0x300
4693static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {
4694 PyTypeObject *type2 = Py_TYPE(operand2);
4696#if defined(_MSC_VER)
4697#pragma warning(push)
4698#pragma warning(disable : 4101)
4700 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4701 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4702#if defined(_MSC_VER)
4706 binaryfunc slot1 = PyString_Type.tp_as_number->nb_remainder;
4707 binaryfunc slot2 = NULL;
4709 if (!(&PyString_Type == type2)) {
4713 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
4715 if (slot1 == slot2) {
4720 if (slot1 != NULL) {
4721 if (slot2 != NULL) {
4722 if (Nuitka_Type_IsSubtype(type2, &PyString_Type)) {
4723 PyObject *x = slot2(operand1, operand2);
4725 if (x != Py_NotImplemented) {
4727 goto exit_binary_result_object;
4730 Py_DECREF_IMMORTAL(x);
4735 PyObject *x = slot1(operand1, operand2);
4737 if (x != Py_NotImplemented) {
4739 goto exit_binary_result_object;
4742 Py_DECREF_IMMORTAL(x);
4745 if (slot2 != NULL) {
4746 PyObject *x = slot2(operand1, operand2);
4748 if (x != Py_NotImplemented) {
4750 goto exit_binary_result_object;
4753 Py_DECREF_IMMORTAL(x);
4756#if PYTHON_VERSION < 0x300
4757 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
4759 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
4762 PyObject *coerced1 = operand1;
4763 PyObject *coerced2 = operand2;
4765 int err = c2(&coerced2, &coerced1);
4767 if (unlikely(err < 0)) {
4768 goto exit_binary_exception;
4772 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
4774 if (likely(mv == NULL)) {
4775 binaryfunc slot = mv->nb_remainder;
4777 if (likely(slot != NULL)) {
4778 PyObject *x = slot(coerced1, coerced2);
4780 Py_DECREF(coerced1);
4781 Py_DECREF(coerced2);
4784 goto exit_binary_result_object;
4789 Py_DECREF(coerced1);
4790 Py_DECREF(coerced2);
4796 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and '%s'", type2->tp_name);
4797 goto exit_binary_exception;
4799exit_binary_result_object:
4802exit_binary_exception:
4805static PyObject *_BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {
4806 CHECK_OBJECT(operand1);
4807 assert(PyString_CheckExact(operand1));
4808 CHECK_OBJECT(operand2);
4810 PyTypeObject *type2 = Py_TYPE(operand2);
4812 if (&PyString_Type == type2) {
4818 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4820 PyObject *x = PyString_Format(operand1, operand2);
4823 goto exit_result_object;
4826 if (unlikely(obj_result == NULL)) {
4827 goto exit_result_exception;
4829 result = obj_result;
4830 goto exit_result_ok;
4835 exit_result_exception:
4839 return __BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(operand1, operand2);
4842PyObject *BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {
4843 return _BINARY_OPERATION_MOD_OBJECT_STR_OBJECT(operand1, operand2);
4847#if PYTHON_VERSION < 0x300
4849static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {
4850 CHECK_OBJECT(operand1);
4851 assert(PyUnicode_CheckExact(operand1));
4852 CHECK_OBJECT(operand2);
4853 assert(PyInt_CheckExact(operand2));
4855#if defined(_MSC_VER)
4856#pragma warning(push)
4857#pragma warning(disable : 4101)
4859 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4860 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4861#if defined(_MSC_VER)
4865 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
4866 binaryfunc slot2 = NULL;
4871 slot2 = PyInt_Type.tp_as_number->nb_remainder;
4874 if (slot1 != NULL) {
4875 PyObject *x = slot1(operand1, operand2);
4877 if (x != Py_NotImplemented) {
4879 goto exit_binary_result_object;
4882 Py_DECREF_IMMORTAL(x);
4885 if (slot2 != NULL) {
4886 PyObject *x = slot2(operand1, operand2);
4888 if (x != Py_NotImplemented) {
4890 goto exit_binary_result_object;
4893 Py_DECREF_IMMORTAL(x);
4898 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'int'");
4899 goto exit_binary_exception;
4901exit_binary_result_object:
4904exit_binary_exception:
4908PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {
4909 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_INT(operand1, operand2);
4915static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {
4916 CHECK_OBJECT(operand1);
4917 assert(PyUnicode_CheckExact(operand1));
4918 CHECK_OBJECT(operand2);
4919 assert(PyLong_CheckExact(operand2));
4921#if defined(_MSC_VER)
4922#pragma warning(push)
4923#pragma warning(disable : 4101)
4925 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4926 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4927#if defined(_MSC_VER)
4931 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
4932 binaryfunc slot2 = NULL;
4937 slot2 = PyLong_Type.tp_as_number->nb_remainder;
4940 if (slot1 != NULL) {
4941 PyObject *x = slot1(operand1, operand2);
4943 if (x != Py_NotImplemented) {
4945 goto exit_binary_result_object;
4948 Py_DECREF_IMMORTAL(x);
4951 if (slot2 != NULL) {
4952 PyObject *x = slot2(operand1, operand2);
4954 if (x != Py_NotImplemented) {
4956 goto exit_binary_result_object;
4959 Py_DECREF_IMMORTAL(x);
4964#if PYTHON_VERSION < 0x300
4965 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'long'");
4967 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'int'");
4969 goto exit_binary_exception;
4971exit_binary_result_object:
4974exit_binary_exception:
4978PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {
4979 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_LONG(operand1, operand2);
4983static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(PyObject *operand1, PyObject *operand2) {
4984 CHECK_OBJECT(operand1);
4985 assert(PyUnicode_CheckExact(operand1));
4986 CHECK_OBJECT(operand2);
4987 assert(PyFloat_CheckExact(operand2));
4989#if defined(_MSC_VER)
4990#pragma warning(push)
4991#pragma warning(disable : 4101)
4993 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4994 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4995#if defined(_MSC_VER)
4999 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5000 binaryfunc slot2 = NULL;
5005 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
5008 if (slot1 != NULL) {
5009 PyObject *x = slot1(operand1, operand2);
5011 if (x != Py_NotImplemented) {
5013 goto exit_binary_result_object;
5016 Py_DECREF_IMMORTAL(x);
5019 if (slot2 != NULL) {
5020 PyObject *x = slot2(operand1, operand2);
5022 if (x != Py_NotImplemented) {
5024 goto exit_binary_result_object;
5027 Py_DECREF_IMMORTAL(x);
5032#if PYTHON_VERSION < 0x300
5033 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'float'");
5035 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'float'");
5037 goto exit_binary_exception;
5039exit_binary_result_object:
5042exit_binary_exception:
5046PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(PyObject *operand1, PyObject *operand2) {
5047 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_FLOAT(operand1, operand2);
5050#if PYTHON_VERSION < 0x300
5052static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2) {
5053 CHECK_OBJECT(operand1);
5054 assert(PyUnicode_CheckExact(operand1));
5055 CHECK_OBJECT(operand2);
5056 assert(PyString_CheckExact(operand2));
5058#if defined(_MSC_VER)
5059#pragma warning(push)
5060#pragma warning(disable : 4101)
5062 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5063 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5064#if defined(_MSC_VER)
5068 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5069 binaryfunc slot2 = NULL;
5074 slot2 = PyString_Type.tp_as_number->nb_remainder;
5077 if (slot1 != NULL) {
5078 PyObject *x = slot1(operand1, operand2);
5080 if (x != Py_NotImplemented) {
5082 goto exit_binary_result_object;
5085 Py_DECREF_IMMORTAL(x);
5088 if (slot2 != NULL) {
5089 PyObject *x = slot2(operand1, operand2);
5091 if (x != Py_NotImplemented) {
5093 goto exit_binary_result_object;
5096 Py_DECREF_IMMORTAL(x);
5101 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'str'");
5102 goto exit_binary_exception;
5104exit_binary_result_object:
5107exit_binary_exception:
5111PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2) {
5112 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_STR(operand1, operand2);
5116#if PYTHON_VERSION >= 0x300
5118static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(PyObject *operand1, PyObject *operand2) {
5119 CHECK_OBJECT(operand1);
5120 assert(PyUnicode_CheckExact(operand1));
5121 CHECK_OBJECT(operand2);
5122 assert(PyBytes_CheckExact(operand2));
5124#if defined(_MSC_VER)
5125#pragma warning(push)
5126#pragma warning(disable : 4101)
5128 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5129 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5130#if defined(_MSC_VER)
5134 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5135 binaryfunc slot2 = NULL;
5140 slot2 = PyBytes_Type.tp_as_number->nb_remainder;
5143 if (slot1 != NULL) {
5144 PyObject *x = slot1(operand1, operand2);
5146 if (x != Py_NotImplemented) {
5148 goto exit_binary_result_object;
5151 Py_DECREF_IMMORTAL(x);
5154 if (slot2 != NULL) {
5155 PyObject *x = slot2(operand1, operand2);
5157 if (x != Py_NotImplemented) {
5159 goto exit_binary_result_object;
5162 Py_DECREF_IMMORTAL(x);
5167 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'bytes'");
5168 goto exit_binary_exception;
5170exit_binary_result_object:
5173exit_binary_exception:
5177PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(PyObject *operand1, PyObject *operand2) {
5178 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_BYTES(operand1, operand2);
5184static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {
5185 CHECK_OBJECT(operand1);
5186 assert(PyUnicode_CheckExact(operand1));
5187 CHECK_OBJECT(operand2);
5188 assert(PyUnicode_CheckExact(operand2));
5193 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5195 PyObject *x = PyUnicode_Format(operand1, operand2);
5198 goto exit_result_object;
5201 if (unlikely(obj_result == NULL)) {
5202 goto exit_result_exception;
5204 result = obj_result;
5205 goto exit_result_ok;
5210exit_result_exception:
5214PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2) {
5215 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_UNICODE(operand1, operand2);
5219static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(PyObject *operand1, PyObject *operand2) {
5220 CHECK_OBJECT(operand1);
5221 assert(PyUnicode_CheckExact(operand1));
5222 CHECK_OBJECT(operand2);
5223 assert(PyTuple_CheckExact(operand2));
5225#if defined(_MSC_VER)
5226#pragma warning(push)
5227#pragma warning(disable : 4101)
5229 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5230 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5231#if defined(_MSC_VER)
5235 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5237 if (slot1 != NULL) {
5238 PyObject *x = slot1(operand1, operand2);
5240 if (x != Py_NotImplemented) {
5242 goto exit_binary_result_object;
5245 Py_DECREF_IMMORTAL(x);
5250#if PYTHON_VERSION < 0x300
5251 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'tuple'");
5253 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'tuple'");
5255 goto exit_binary_exception;
5257exit_binary_result_object:
5260exit_binary_exception:
5264PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(PyObject *operand1, PyObject *operand2) {
5265 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_TUPLE(operand1, operand2);
5269static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(PyObject *operand1, PyObject *operand2) {
5270 CHECK_OBJECT(operand1);
5271 assert(PyUnicode_CheckExact(operand1));
5272 CHECK_OBJECT(operand2);
5273 assert(PyList_CheckExact(operand2));
5275#if defined(_MSC_VER)
5276#pragma warning(push)
5277#pragma warning(disable : 4101)
5279 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5280 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5281#if defined(_MSC_VER)
5285 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5287 if (slot1 != NULL) {
5288 PyObject *x = slot1(operand1, operand2);
5290 if (x != Py_NotImplemented) {
5292 goto exit_binary_result_object;
5295 Py_DECREF_IMMORTAL(x);
5300#if PYTHON_VERSION < 0x300
5301 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'list'");
5303 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'list'");
5305 goto exit_binary_exception;
5307exit_binary_result_object:
5310exit_binary_exception:
5314PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(PyObject *operand1, PyObject *operand2) {
5315 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_LIST(operand1, operand2);
5319static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(PyObject *operand1, PyObject *operand2) {
5320 CHECK_OBJECT(operand1);
5321 assert(PyUnicode_CheckExact(operand1));
5322 CHECK_OBJECT(operand2);
5323 assert(PyDict_CheckExact(operand2));
5325#if defined(_MSC_VER)
5326#pragma warning(push)
5327#pragma warning(disable : 4101)
5329 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5330 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5331#if defined(_MSC_VER)
5335 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5337 if (slot1 != NULL) {
5338 PyObject *x = slot1(operand1, operand2);
5340 if (x != Py_NotImplemented) {
5342 goto exit_binary_result_object;
5345 Py_DECREF_IMMORTAL(x);
5350#if PYTHON_VERSION < 0x300
5351 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and 'dict'");
5353 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and 'dict'");
5355 goto exit_binary_exception;
5357exit_binary_result_object:
5360exit_binary_exception:
5364PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(PyObject *operand1, PyObject *operand2) {
5365 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_DICT(operand1, operand2);
5369static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1,
5370 PyObject *operand2) {
5371 PyTypeObject *type2 = Py_TYPE(operand2);
5373#if defined(_MSC_VER)
5374#pragma warning(push)
5375#pragma warning(disable : 4101)
5377 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5378 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5379#if defined(_MSC_VER)
5383 binaryfunc slot1 = PyUnicode_Type.tp_as_number->nb_remainder;
5384 binaryfunc slot2 = NULL;
5386 if (!(&PyUnicode_Type == type2)) {
5390 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
5392 if (slot1 == slot2) {
5397 if (slot1 != NULL) {
5398 if (slot2 != NULL) {
5399 if (Nuitka_Type_IsSubtype(type2, &PyUnicode_Type)) {
5400 PyObject *x = slot2(operand1, operand2);
5402 if (x != Py_NotImplemented) {
5404 goto exit_binary_result_object;
5407 Py_DECREF_IMMORTAL(x);
5412 PyObject *x = slot1(operand1, operand2);
5414 if (x != Py_NotImplemented) {
5416 goto exit_binary_result_object;
5419 Py_DECREF_IMMORTAL(x);
5422 if (slot2 != NULL) {
5423 PyObject *x = slot2(operand1, operand2);
5425 if (x != Py_NotImplemented) {
5427 goto exit_binary_result_object;
5430 Py_DECREF_IMMORTAL(x);
5433#if PYTHON_VERSION < 0x300
5434 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
5436 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
5439 PyObject *coerced1 = operand1;
5440 PyObject *coerced2 = operand2;
5442 int err = c2(&coerced2, &coerced1);
5444 if (unlikely(err < 0)) {
5445 goto exit_binary_exception;
5449 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5451 if (likely(mv == NULL)) {
5452 binaryfunc slot = mv->nb_remainder;
5454 if (likely(slot != NULL)) {
5455 PyObject *x = slot(coerced1, coerced2);
5457 Py_DECREF(coerced1);
5458 Py_DECREF(coerced2);
5461 goto exit_binary_result_object;
5466 Py_DECREF(coerced1);
5467 Py_DECREF(coerced2);
5473#if PYTHON_VERSION < 0x300
5474 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'unicode' and '%s'", type2->tp_name);
5476 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'str' and '%s'", type2->tp_name);
5478 goto exit_binary_exception;
5480exit_binary_result_object:
5483exit_binary_exception:
5486static PyObject *_BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {
5487 CHECK_OBJECT(operand1);
5488 assert(PyUnicode_CheckExact(operand1));
5489 CHECK_OBJECT(operand2);
5491 PyTypeObject *type2 = Py_TYPE(operand2);
5493 if (&PyUnicode_Type == type2) {
5499 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5501 PyObject *x = PyUnicode_Format(operand1, operand2);
5504 goto exit_result_object;
5507 if (unlikely(obj_result == NULL)) {
5508 goto exit_result_exception;
5510 result = obj_result;
5511 goto exit_result_ok;
5516 exit_result_exception:
5520 return __BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(operand1, operand2);
5523PyObject *BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {
5524 return _BINARY_OPERATION_MOD_OBJECT_UNICODE_OBJECT(operand1, operand2);
5527#if PYTHON_VERSION >= 0x300
5529static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {
5530 CHECK_OBJECT(operand1);
5531 assert(PyBytes_CheckExact(operand1));
5532 CHECK_OBJECT(operand2);
5533 assert(PyLong_CheckExact(operand2));
5535#if defined(_MSC_VER)
5536#pragma warning(push)
5537#pragma warning(disable : 4101)
5539 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5540 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5541#if defined(_MSC_VER)
5545 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5546 binaryfunc slot2 = NULL;
5551 slot2 = PyLong_Type.tp_as_number->nb_remainder;
5554 if (slot1 != NULL) {
5555 PyObject *x = slot1(operand1, operand2);
5557 if (x != Py_NotImplemented) {
5559 goto exit_binary_result_object;
5562 Py_DECREF_IMMORTAL(x);
5565 if (slot2 != NULL) {
5566 PyObject *x = slot2(operand1, operand2);
5568 if (x != Py_NotImplemented) {
5570 goto exit_binary_result_object;
5573 Py_DECREF_IMMORTAL(x);
5578 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and 'int'");
5579 goto exit_binary_exception;
5581exit_binary_result_object:
5584exit_binary_exception:
5588PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {
5589 return _BINARY_OPERATION_MOD_OBJECT_BYTES_LONG(operand1, operand2);
5593#if PYTHON_VERSION >= 0x300
5595static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(PyObject *operand1, PyObject *operand2) {
5596 CHECK_OBJECT(operand1);
5597 assert(PyBytes_CheckExact(operand1));
5598 CHECK_OBJECT(operand2);
5599 assert(PyFloat_CheckExact(operand2));
5601#if defined(_MSC_VER)
5602#pragma warning(push)
5603#pragma warning(disable : 4101)
5605 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5606 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5607#if defined(_MSC_VER)
5611 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5612 binaryfunc slot2 = NULL;
5617 slot2 = PyFloat_Type.tp_as_number->nb_remainder;
5620 if (slot1 != NULL) {
5621 PyObject *x = slot1(operand1, operand2);
5623 if (x != Py_NotImplemented) {
5625 goto exit_binary_result_object;
5628 Py_DECREF_IMMORTAL(x);
5631 if (slot2 != NULL) {
5632 PyObject *x = slot2(operand1, operand2);
5634 if (x != Py_NotImplemented) {
5636 goto exit_binary_result_object;
5639 Py_DECREF_IMMORTAL(x);
5644 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and 'float'");
5645 goto exit_binary_exception;
5647exit_binary_result_object:
5650exit_binary_exception:
5654PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(PyObject *operand1, PyObject *operand2) {
5655 return _BINARY_OPERATION_MOD_OBJECT_BYTES_FLOAT(operand1, operand2);
5659#if PYTHON_VERSION >= 0x300
5661static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {
5662 CHECK_OBJECT(operand1);
5663 assert(PyBytes_CheckExact(operand1));
5664 CHECK_OBJECT(operand2);
5665 assert(PyBytes_CheckExact(operand2));
5670 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5672 PyObject *x = PyBytes_Type.tp_as_number->nb_remainder(operand1, operand2);
5673 assert(x != Py_NotImplemented);
5676 goto exit_result_object;
5679 if (unlikely(obj_result == NULL)) {
5680 goto exit_result_exception;
5682 result = obj_result;
5683 goto exit_result_ok;
5688exit_result_exception:
5692PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2) {
5693 return _BINARY_OPERATION_MOD_OBJECT_BYTES_BYTES(operand1, operand2);
5697#if PYTHON_VERSION >= 0x300
5699static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(PyObject *operand1, PyObject *operand2) {
5700 CHECK_OBJECT(operand1);
5701 assert(PyBytes_CheckExact(operand1));
5702 CHECK_OBJECT(operand2);
5703 assert(PyUnicode_CheckExact(operand2));
5705#if defined(_MSC_VER)
5706#pragma warning(push)
5707#pragma warning(disable : 4101)
5709 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5710 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5711#if defined(_MSC_VER)
5715 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5716 binaryfunc slot2 = NULL;
5721 slot2 = PyUnicode_Type.tp_as_number->nb_remainder;
5724 if (slot1 != NULL) {
5725 PyObject *x = slot1(operand1, operand2);
5727 if (x != Py_NotImplemented) {
5729 goto exit_binary_result_object;
5732 Py_DECREF_IMMORTAL(x);
5735 if (slot2 != NULL) {
5736 PyObject *x = slot2(operand1, operand2);
5738 if (x != Py_NotImplemented) {
5740 goto exit_binary_result_object;
5743 Py_DECREF_IMMORTAL(x);
5748 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and 'str'");
5749 goto exit_binary_exception;
5751exit_binary_result_object:
5754exit_binary_exception:
5758PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(PyObject *operand1, PyObject *operand2) {
5759 return _BINARY_OPERATION_MOD_OBJECT_BYTES_UNICODE(operand1, operand2);
5763#if PYTHON_VERSION >= 0x300
5765static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(PyObject *operand1, PyObject *operand2) {
5766 CHECK_OBJECT(operand1);
5767 assert(PyBytes_CheckExact(operand1));
5768 CHECK_OBJECT(operand2);
5769 assert(PyTuple_CheckExact(operand2));
5771#if defined(_MSC_VER)
5772#pragma warning(push)
5773#pragma warning(disable : 4101)
5775 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5776 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5777#if defined(_MSC_VER)
5781 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5783 if (slot1 != NULL) {
5784 PyObject *x = slot1(operand1, operand2);
5786 if (x != Py_NotImplemented) {
5788 goto exit_binary_result_object;
5791 Py_DECREF_IMMORTAL(x);
5796 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and 'tuple'");
5797 goto exit_binary_exception;
5799exit_binary_result_object:
5802exit_binary_exception:
5806PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(PyObject *operand1, PyObject *operand2) {
5807 return _BINARY_OPERATION_MOD_OBJECT_BYTES_TUPLE(operand1, operand2);
5811#if PYTHON_VERSION >= 0x300
5813static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(PyObject *operand1, PyObject *operand2) {
5814 CHECK_OBJECT(operand1);
5815 assert(PyBytes_CheckExact(operand1));
5816 CHECK_OBJECT(operand2);
5817 assert(PyList_CheckExact(operand2));
5819#if defined(_MSC_VER)
5820#pragma warning(push)
5821#pragma warning(disable : 4101)
5823 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5824 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5825#if defined(_MSC_VER)
5829 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5831 if (slot1 != NULL) {
5832 PyObject *x = slot1(operand1, operand2);
5834 if (x != Py_NotImplemented) {
5836 goto exit_binary_result_object;
5839 Py_DECREF_IMMORTAL(x);
5844 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and 'list'");
5845 goto exit_binary_exception;
5847exit_binary_result_object:
5850exit_binary_exception:
5854PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(PyObject *operand1, PyObject *operand2) {
5855 return _BINARY_OPERATION_MOD_OBJECT_BYTES_LIST(operand1, operand2);
5859#if PYTHON_VERSION >= 0x300
5861static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(PyObject *operand1, PyObject *operand2) {
5862 CHECK_OBJECT(operand1);
5863 assert(PyBytes_CheckExact(operand1));
5864 CHECK_OBJECT(operand2);
5865 assert(PyDict_CheckExact(operand2));
5867#if defined(_MSC_VER)
5868#pragma warning(push)
5869#pragma warning(disable : 4101)
5871 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5872 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5873#if defined(_MSC_VER)
5877 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5879 if (slot1 != NULL) {
5880 PyObject *x = slot1(operand1, operand2);
5882 if (x != Py_NotImplemented) {
5884 goto exit_binary_result_object;
5887 Py_DECREF_IMMORTAL(x);
5892 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and 'dict'");
5893 goto exit_binary_exception;
5895exit_binary_result_object:
5898exit_binary_exception:
5902PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(PyObject *operand1, PyObject *operand2) {
5903 return _BINARY_OPERATION_MOD_OBJECT_BYTES_DICT(operand1, operand2);
5907#if PYTHON_VERSION >= 0x300
5909static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1,
5910 PyObject *operand2) {
5911 PyTypeObject *type2 = Py_TYPE(operand2);
5913#if defined(_MSC_VER)
5914#pragma warning(push)
5915#pragma warning(disable : 4101)
5917 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5918 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5919#if defined(_MSC_VER)
5923 binaryfunc slot1 = PyBytes_Type.tp_as_number->nb_remainder;
5924 binaryfunc slot2 = NULL;
5926 if (!(&PyBytes_Type == type2)) {
5930 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
5932 if (slot1 == slot2) {
5937 if (slot1 != NULL) {
5938 if (slot2 != NULL) {
5939 if (Nuitka_Type_IsSubtype(type2, &PyBytes_Type)) {
5940 PyObject *x = slot2(operand1, operand2);
5942 if (x != Py_NotImplemented) {
5944 goto exit_binary_result_object;
5947 Py_DECREF_IMMORTAL(x);
5952 PyObject *x = slot1(operand1, operand2);
5954 if (x != Py_NotImplemented) {
5956 goto exit_binary_result_object;
5959 Py_DECREF_IMMORTAL(x);
5962 if (slot2 != NULL) {
5963 PyObject *x = slot2(operand1, operand2);
5965 if (x != Py_NotImplemented) {
5967 goto exit_binary_result_object;
5970 Py_DECREF_IMMORTAL(x);
5973#if PYTHON_VERSION < 0x300
5974 if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
5976 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
5979 PyObject *coerced1 = operand1;
5980 PyObject *coerced2 = operand2;
5982 int err = c2(&coerced2, &coerced1);
5984 if (unlikely(err < 0)) {
5985 goto exit_binary_exception;
5989 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5991 if (likely(mv == NULL)) {
5992 binaryfunc slot = mv->nb_remainder;
5994 if (likely(slot != NULL)) {
5995 PyObject *x = slot(coerced1, coerced2);
5997 Py_DECREF(coerced1);
5998 Py_DECREF(coerced2);
6001 goto exit_binary_result_object;
6006 Py_DECREF(coerced1);
6007 Py_DECREF(coerced2);
6013 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: 'bytes' and '%s'", type2->tp_name);
6014 goto exit_binary_exception;
6016exit_binary_result_object:
6019exit_binary_exception:
6022static PyObject *_BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {
6023 CHECK_OBJECT(operand1);
6024 assert(PyBytes_CheckExact(operand1));
6025 CHECK_OBJECT(operand2);
6027 PyTypeObject *type2 = Py_TYPE(operand2);
6029 if (&PyBytes_Type == type2) {
6035 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6037 PyObject *x = PyBytes_Type.tp_as_number->nb_remainder(operand1, operand2);
6038 assert(x != Py_NotImplemented);
6041 goto exit_result_object;
6044 if (unlikely(obj_result == NULL)) {
6045 goto exit_result_exception;
6047 result = obj_result;
6048 goto exit_result_ok;
6053 exit_result_exception:
6057 return __BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(operand1, operand2);
6060PyObject *BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {
6061 return _BINARY_OPERATION_MOD_OBJECT_BYTES_OBJECT(operand1, operand2);
6066static PyObject *_BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6067 CHECK_OBJECT(operand1);
6068 CHECK_OBJECT(operand2);
6070#if PYTHON_VERSION < 0x300
6071 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
6075#if defined(_MSC_VER)
6076#pragma warning(push)
6077#pragma warning(disable : 4101)
6079 NUITKA_MAY_BE_UNUSED
bool cbool_result;
6080 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6081 NUITKA_MAY_BE_UNUSED
long clong_result;
6082 NUITKA_MAY_BE_UNUSED
double cfloat_result;
6083#if defined(_MSC_VER)
6087 CHECK_OBJECT(operand1);
6088 assert(PyInt_CheckExact(operand1));
6089 CHECK_OBJECT(operand2);
6090 assert(PyInt_CheckExact(operand2));
6092 const long a = PyInt_AS_LONG(operand1);
6093 const long b = PyInt_AS_LONG(operand2);
6101 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
6105 if (r != 0 && ((b ^ r) < 0)) {
6110 goto exit_result_ok_clong;
6114 PyObject *operand1_object = operand1;
6115 PyObject *operand2_object = operand2;
6117 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
6118 assert(r != Py_NotImplemented);
6121 goto exit_result_object;
6124 exit_result_ok_clong:
6125 result = Nuitka_PyInt_FromLong(clong_result);
6126 goto exit_result_ok;
6129 if (unlikely(obj_result == NULL)) {
6130 goto exit_result_exception;
6132 result = obj_result;
6133 goto exit_result_ok;
6138 exit_result_exception:
6143 PyTypeObject *type1 = Py_TYPE(operand1);
6144 PyTypeObject *type2 = Py_TYPE(operand2);
6146#if defined(_MSC_VER)
6147#pragma warning(push)
6148#pragma warning(disable : 4101)
6150 NUITKA_MAY_BE_UNUSED
bool cbool_result;
6151 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6152#if defined(_MSC_VER)
6157 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
6158 binaryfunc slot2 = NULL;
6160 if (!(type1 == type2)) {
6164 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
6166 if (slot1 == slot2) {
6171 if (slot1 != NULL) {
6172 if (slot2 != NULL) {
6173 if (Nuitka_Type_IsSubtype(type2, type1)) {
6174 PyObject *x = slot2(operand1, operand2);
6176 if (x != Py_NotImplemented) {
6178 goto exit_binary_result_object;
6181 Py_DECREF_IMMORTAL(x);
6186 PyObject *x = slot1(operand1, operand2);
6188 if (x != Py_NotImplemented) {
6190 goto exit_binary_result_object;
6193 Py_DECREF_IMMORTAL(x);
6196 if (slot2 != NULL) {
6197 PyObject *x = slot2(operand1, operand2);
6199 if (x != Py_NotImplemented) {
6201 goto exit_binary_result_object;
6204 Py_DECREF_IMMORTAL(x);
6207#if PYTHON_VERSION < 0x300
6208 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
6210 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
6213 PyObject *coerced1 = operand1;
6214 PyObject *coerced2 = operand2;
6216 int err = c1(&coerced1, &coerced2);
6218 if (unlikely(err < 0)) {
6219 goto exit_binary_exception;
6223 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6225 if (likely(mv == NULL)) {
6226 binaryfunc slot = mv->nb_remainder;
6228 if (likely(slot != NULL)) {
6229 PyObject *x = slot(coerced1, coerced2);
6231 Py_DECREF(coerced1);
6232 Py_DECREF(coerced2);
6235 goto exit_binary_result_object;
6240 Py_DECREF(coerced1);
6241 Py_DECREF(coerced2);
6245 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
6248 PyObject *coerced1 = operand1;
6249 PyObject *coerced2 = operand2;
6251 int err = c2(&coerced2, &coerced1);
6253 if (unlikely(err < 0)) {
6254 goto exit_binary_exception;
6258 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6260 if (likely(mv == NULL)) {
6261 binaryfunc slot = mv->nb_remainder;
6263 if (likely(slot != NULL)) {
6264 PyObject *x = slot(coerced1, coerced2);
6266 Py_DECREF(coerced1);
6267 Py_DECREF(coerced2);
6270 goto exit_binary_result_object;
6275 Py_DECREF(coerced1);
6276 Py_DECREF(coerced2);
6282 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and '%s'", type1->tp_name, type2->tp_name);
6283 goto exit_binary_exception;
6285exit_binary_result_object:
6288exit_binary_exception:
6292PyObject *BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6293 return _BINARY_OPERATION_MOD_OBJECT_OBJECT_OBJECT(operand1, operand2);
6297static nuitka_bool _BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6298 CHECK_OBJECT(operand1);
6299 CHECK_OBJECT(operand2);
6301#if PYTHON_VERSION < 0x300
6302 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
6306#if defined(_MSC_VER)
6307#pragma warning(push)
6308#pragma warning(disable : 4101)
6310 NUITKA_MAY_BE_UNUSED
bool cbool_result;
6311 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6312 NUITKA_MAY_BE_UNUSED
long clong_result;
6313 NUITKA_MAY_BE_UNUSED
double cfloat_result;
6314#if defined(_MSC_VER)
6318 CHECK_OBJECT(operand1);
6319 assert(PyInt_CheckExact(operand1));
6320 CHECK_OBJECT(operand2);
6321 assert(PyInt_CheckExact(operand2));
6323 const long a = PyInt_AS_LONG(operand1);
6324 const long b = PyInt_AS_LONG(operand2);
6332 if (likely(b != -1 || !UNARY_NEG_WOULD_OVERFLOW(a))) {
6336 if (r != 0 && ((b ^ r) < 0)) {
6341 goto exit_result_ok_clong;
6345 PyObject *operand1_object = operand1;
6346 PyObject *operand2_object = operand2;
6348 PyObject *r = PyLong_Type.tp_as_number->nb_remainder(operand1_object, operand2_object);
6349 assert(r != Py_NotImplemented);
6352 goto exit_result_object;
6355 exit_result_ok_clong:
6356 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
6357 goto exit_result_ok;
6360 if (unlikely(obj_result == NULL)) {
6361 goto exit_result_exception;
6363 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
6364 Py_DECREF(obj_result);
6365 goto exit_result_ok;
6370 exit_result_exception:
6371 return NUITKA_BOOL_EXCEPTION;
6375 PyTypeObject *type1 = Py_TYPE(operand1);
6376 PyTypeObject *type2 = Py_TYPE(operand2);
6378#if defined(_MSC_VER)
6379#pragma warning(push)
6380#pragma warning(disable : 4101)
6382 NUITKA_MAY_BE_UNUSED
bool cbool_result;
6383 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6384#if defined(_MSC_VER)
6389 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_remainder : NULL;
6390 binaryfunc slot2 = NULL;
6392 if (!(type1 == type2)) {
6396 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_remainder : NULL;
6398 if (slot1 == slot2) {
6403 if (slot1 != NULL) {
6404 if (slot2 != NULL) {
6405 if (Nuitka_Type_IsSubtype(type2, type1)) {
6406 PyObject *x = slot2(operand1, operand2);
6408 if (x != Py_NotImplemented) {
6410 goto exit_binary_result_object;
6413 Py_DECREF_IMMORTAL(x);
6418 PyObject *x = slot1(operand1, operand2);
6420 if (x != Py_NotImplemented) {
6422 goto exit_binary_result_object;
6425 Py_DECREF_IMMORTAL(x);
6428 if (slot2 != NULL) {
6429 PyObject *x = slot2(operand1, operand2);
6431 if (x != Py_NotImplemented) {
6433 goto exit_binary_result_object;
6436 Py_DECREF_IMMORTAL(x);
6439#if PYTHON_VERSION < 0x300
6440 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
6442 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
6445 PyObject *coerced1 = operand1;
6446 PyObject *coerced2 = operand2;
6448 int err = c1(&coerced1, &coerced2);
6450 if (unlikely(err < 0)) {
6451 goto exit_binary_exception;
6455 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6457 if (likely(mv == NULL)) {
6458 binaryfunc slot = mv->nb_remainder;
6460 if (likely(slot != NULL)) {
6461 PyObject *x = slot(coerced1, coerced2);
6463 Py_DECREF(coerced1);
6464 Py_DECREF(coerced2);
6467 goto exit_binary_result_object;
6472 Py_DECREF(coerced1);
6473 Py_DECREF(coerced2);
6477 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
6480 PyObject *coerced1 = operand1;
6481 PyObject *coerced2 = operand2;
6483 int err = c2(&coerced2, &coerced1);
6485 if (unlikely(err < 0)) {
6486 goto exit_binary_exception;
6490 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6492 if (likely(mv == NULL)) {
6493 binaryfunc slot = mv->nb_remainder;
6495 if (likely(slot != NULL)) {
6496 PyObject *x = slot(coerced1, coerced2);
6498 Py_DECREF(coerced1);
6499 Py_DECREF(coerced2);
6502 goto exit_binary_result_object;
6507 Py_DECREF(coerced1);
6508 Py_DECREF(coerced2);
6514 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %%: '%s' and '%s'", type1->tp_name, type2->tp_name);
6515 goto exit_binary_exception;
6517exit_binary_result_object:
6518 if (unlikely(obj_result == NULL)) {
6519 return NUITKA_BOOL_EXCEPTION;
6523 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
6524 Py_DECREF(obj_result);
6528exit_binary_exception:
6529 return NUITKA_BOOL_EXCEPTION;
6532nuitka_bool BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6533 return _BINARY_OPERATION_MOD_NBOOL_OBJECT_OBJECT(operand1, operand2);