7#include "nuitka/prelude.h"
10#include "HelpersOperationBinaryMultUtils.c"
13#if PYTHON_VERSION < 0x300
15static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
16 CHECK_OBJECT(operand1);
17 assert(PyInt_CheckExact(operand1));
18 CHECK_OBJECT(operand2);
19 assert(PyInt_CheckExact(operand2));
26#pragma warning(disable : 4101)
28 NUITKA_MAY_BE_UNUSED
bool cbool_result;
29 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
30 NUITKA_MAY_BE_UNUSED
long clong_result;
31 NUITKA_MAY_BE_UNUSED
double cfloat_result;
36 CHECK_OBJECT(operand1);
37 assert(PyInt_CheckExact(operand1));
38 CHECK_OBJECT(operand2);
39 assert(PyInt_CheckExact(operand2));
41 const long a = PyInt_AS_LONG(operand1);
42 const long b = PyInt_AS_LONG(operand2);
44 const long longprod = (long)((
unsigned long)a * b);
45 const double doubleprod = (double)a * (
double)b;
46 const double doubled_longprod = (double)longprod;
48 if (likely(doubled_longprod == doubleprod)) {
49 clong_result = longprod;
50 goto exit_result_ok_clong;
52 const double diff = doubled_longprod - doubleprod;
53 const double absdiff = diff >= 0.0 ? diff : -diff;
54 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
56 if (likely(32.0 * absdiff <= absprod)) {
57 clong_result = longprod;
58 goto exit_result_ok_clong;
63 PyObject *operand1_object = operand1;
64 PyObject *operand2_object = operand2;
66 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
67 assert(r != Py_NotImplemented);
70 goto exit_result_object;
74 result = Nuitka_PyInt_FromLong(clong_result);
78 if (unlikely(obj_result == NULL)) {
79 goto exit_result_exception;
91PyObject *BINARY_OPERATION_MULT_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
92 return _BINARY_OPERATION_MULT_OBJECT_INT_INT(operand1, operand2);
96#if PYTHON_VERSION < 0x300
98static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
99 PyTypeObject *type1 = Py_TYPE(operand1);
103#pragma warning(disable : 4101)
105 NUITKA_MAY_BE_UNUSED
bool cbool_result;
106 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
112 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
113 binaryfunc slot2 = NULL;
115 if (!(type1 == &PyInt_Type)) {
118 slot2 = PyInt_Type.tp_as_number->nb_multiply;
120 if (slot1 == slot2) {
126 PyObject *x = slot1(operand1, operand2);
128 if (x != Py_NotImplemented) {
130 goto exit_binary_result_object;
133 Py_DECREF_IMMORTAL(x);
137 PyObject *x = slot2(operand1, operand2);
139 if (x != Py_NotImplemented) {
141 goto exit_binary_result_object;
144 Py_DECREF_IMMORTAL(x);
147#if PYTHON_VERSION < 0x300
148 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
150 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
153 PyObject *coerced1 = operand1;
154 PyObject *coerced2 = operand2;
156 int err = c1(&coerced1, &coerced2);
158 if (unlikely(err < 0)) {
159 goto exit_binary_exception;
163 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
165 if (likely(mv == NULL)) {
166 binaryfunc slot = mv->nb_multiply;
168 if (likely(slot != NULL)) {
169 PyObject *x = slot(coerced1, coerced2);
175 goto exit_binary_result_object;
184 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
187 PyObject *coerced1 = operand1;
188 PyObject *coerced2 = operand2;
190 int err = c2(&coerced2, &coerced1);
192 if (unlikely(err < 0)) {
193 goto exit_binary_exception;
197 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
199 if (likely(mv == NULL)) {
200 binaryfunc slot = mv->nb_multiply;
202 if (likely(slot != NULL)) {
203 PyObject *x = slot(coerced1, coerced2);
209 goto exit_binary_result_object;
223 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
225 if (sq_slot != NULL) {
226 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
229 goto exit_binary_result_object;
234 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'int'", type1->tp_name);
235 goto exit_binary_exception;
237exit_binary_result_object:
240exit_binary_exception:
243static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
244 CHECK_OBJECT(operand1);
245 CHECK_OBJECT(operand2);
246 assert(PyInt_CheckExact(operand2));
248 PyTypeObject *type1 = Py_TYPE(operand1);
250 if (type1 == &PyInt_Type) {
258#pragma warning(disable : 4101)
260 NUITKA_MAY_BE_UNUSED
bool cbool_result;
261 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
262 NUITKA_MAY_BE_UNUSED
long clong_result;
263 NUITKA_MAY_BE_UNUSED
double cfloat_result;
268 CHECK_OBJECT(operand1);
269 assert(PyInt_CheckExact(operand1));
270 CHECK_OBJECT(operand2);
271 assert(PyInt_CheckExact(operand2));
273 const long a = PyInt_AS_LONG(operand1);
274 const long b = PyInt_AS_LONG(operand2);
276 const long longprod = (long)((
unsigned long)a * b);
277 const double doubleprod = (double)a * (
double)b;
278 const double doubled_longprod = (double)longprod;
280 if (likely(doubled_longprod == doubleprod)) {
281 clong_result = longprod;
282 goto exit_result_ok_clong;
284 const double diff = doubled_longprod - doubleprod;
285 const double absdiff = diff >= 0.0 ? diff : -diff;
286 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
288 if (likely(32.0 * absdiff <= absprod)) {
289 clong_result = longprod;
290 goto exit_result_ok_clong;
295 PyObject *operand1_object = operand1;
296 PyObject *operand2_object = operand2;
298 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
299 assert(r != Py_NotImplemented);
302 goto exit_result_object;
305 exit_result_ok_clong:
306 result = Nuitka_PyInt_FromLong(clong_result);
310 if (unlikely(obj_result == NULL)) {
311 goto exit_result_exception;
319 exit_result_exception:
323 return __BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(operand1, operand2);
326PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
327 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_INT(operand1, operand2);
331#if PYTHON_VERSION < 0x300
333static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
334 PyTypeObject *type2 = Py_TYPE(operand2);
338#pragma warning(disable : 4101)
340 NUITKA_MAY_BE_UNUSED
bool cbool_result;
341 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
346 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_multiply;
347 binaryfunc slot2 = NULL;
349 if (!(&PyInt_Type == type2)) {
352 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
354 if (slot1 == slot2) {
361 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
362 PyObject *x = slot2(operand1, operand2);
364 if (x != Py_NotImplemented) {
366 goto exit_binary_result_object;
369 Py_DECREF_IMMORTAL(x);
374 PyObject *x = slot1(operand1, operand2);
376 if (x != Py_NotImplemented) {
378 goto exit_binary_result_object;
381 Py_DECREF_IMMORTAL(x);
385 PyObject *x = slot2(operand1, operand2);
387 if (x != Py_NotImplemented) {
389 goto exit_binary_result_object;
392 Py_DECREF_IMMORTAL(x);
395#if PYTHON_VERSION < 0x300
396 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
397 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
400 PyObject *coerced1 = operand1;
401 PyObject *coerced2 = operand2;
403 int err = c1(&coerced1, &coerced2);
405 if (unlikely(err < 0)) {
406 goto exit_binary_exception;
410 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
412 if (likely(mv == NULL)) {
413 binaryfunc slot = mv->nb_multiply;
415 if (likely(slot != NULL)) {
416 PyObject *x = slot(coerced1, coerced2);
422 goto exit_binary_result_object;
432 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
435 PyObject *coerced1 = operand1;
436 PyObject *coerced2 = operand2;
438 int err = c2(&coerced2, &coerced1);
440 if (unlikely(err < 0)) {
441 goto exit_binary_exception;
445 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
447 if (likely(mv == NULL)) {
448 binaryfunc slot = mv->nb_multiply;
450 if (likely(slot != NULL)) {
451 PyObject *x = slot(coerced1, coerced2);
457 goto exit_binary_result_object;
474 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
476 if (sq_slot != NULL) {
477 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
480 goto exit_binary_result_object;
484 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'int' and '%s'", type2->tp_name);
485 goto exit_binary_exception;
487exit_binary_result_object:
490exit_binary_exception:
493static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
494 CHECK_OBJECT(operand1);
495 assert(PyInt_CheckExact(operand1));
496 CHECK_OBJECT(operand2);
498 PyTypeObject *type2 = Py_TYPE(operand2);
500 if (&PyInt_Type == type2) {
508#pragma warning(disable : 4101)
510 NUITKA_MAY_BE_UNUSED
bool cbool_result;
511 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
512 NUITKA_MAY_BE_UNUSED
long clong_result;
513 NUITKA_MAY_BE_UNUSED
double cfloat_result;
518 CHECK_OBJECT(operand1);
519 assert(PyInt_CheckExact(operand1));
520 CHECK_OBJECT(operand2);
521 assert(PyInt_CheckExact(operand2));
523 const long a = PyInt_AS_LONG(operand1);
524 const long b = PyInt_AS_LONG(operand2);
526 const long longprod = (long)((
unsigned long)a * b);
527 const double doubleprod = (double)a * (
double)b;
528 const double doubled_longprod = (double)longprod;
530 if (likely(doubled_longprod == doubleprod)) {
531 clong_result = longprod;
532 goto exit_result_ok_clong;
534 const double diff = doubled_longprod - doubleprod;
535 const double absdiff = diff >= 0.0 ? diff : -diff;
536 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
538 if (likely(32.0 * absdiff <= absprod)) {
539 clong_result = longprod;
540 goto exit_result_ok_clong;
545 PyObject *operand1_object = operand1;
546 PyObject *operand2_object = operand2;
548 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
549 assert(r != Py_NotImplemented);
552 goto exit_result_object;
555 exit_result_ok_clong:
556 result = Nuitka_PyInt_FromLong(clong_result);
560 if (unlikely(obj_result == NULL)) {
561 goto exit_result_exception;
569 exit_result_exception:
573 return __BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(operand1, operand2);
576PyObject *BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
577 return _BINARY_OPERATION_MULT_OBJECT_INT_OBJECT(operand1, operand2);
581#if PYTHON_VERSION < 0x300
583static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
584 CHECK_OBJECT(operand1);
585 assert(PyInt_CheckExact(operand1));
586 CHECK_OBJECT(operand2);
587 assert(PyInt_CheckExact(operand2));
594#pragma warning(disable : 4101)
596 NUITKA_MAY_BE_UNUSED
bool cbool_result;
597 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
598 NUITKA_MAY_BE_UNUSED
long clong_result;
599 NUITKA_MAY_BE_UNUSED
double cfloat_result;
604 CHECK_OBJECT(operand1);
605 assert(PyInt_CheckExact(operand1));
606 CHECK_OBJECT(operand2);
607 assert(PyInt_CheckExact(operand2));
609 const long a = PyInt_AS_LONG(operand1);
610 const long b = PyInt_AS_LONG(operand2);
612 const long longprod = (long)((
unsigned long)a * b);
613 const double doubleprod = (double)a * (
double)b;
614 const double doubled_longprod = (double)longprod;
616 if (likely(doubled_longprod == doubleprod)) {
617 clong_result = longprod;
618 goto exit_result_ok_clong;
620 const double diff = doubled_longprod - doubleprod;
621 const double absdiff = diff >= 0.0 ? diff : -diff;
622 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
624 if (likely(32.0 * absdiff <= absprod)) {
625 clong_result = longprod;
626 goto exit_result_ok_clong;
631 PyObject *operand1_object = operand1;
632 PyObject *operand2_object = operand2;
634 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
635 assert(r != Py_NotImplemented);
638 goto exit_result_object;
642 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
646 if (unlikely(obj_result == NULL)) {
647 goto exit_result_exception;
649 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
650 Py_DECREF(obj_result);
656exit_result_exception:
657 return NUITKA_BOOL_EXCEPTION;
660nuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2) {
661 return _BINARY_OPERATION_MULT_NBOOL_INT_INT(operand1, operand2);
665#if PYTHON_VERSION < 0x300
667static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1,
668 PyObject *operand2) {
669 PyTypeObject *type1 = Py_TYPE(operand1);
673#pragma warning(disable : 4101)
675 NUITKA_MAY_BE_UNUSED
bool cbool_result;
676 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
682 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
683 binaryfunc slot2 = NULL;
685 if (!(type1 == &PyInt_Type)) {
688 slot2 = PyInt_Type.tp_as_number->nb_multiply;
690 if (slot1 == slot2) {
696 PyObject *x = slot1(operand1, operand2);
698 if (x != Py_NotImplemented) {
700 goto exit_binary_result_object;
703 Py_DECREF_IMMORTAL(x);
707 PyObject *x = slot2(operand1, operand2);
709 if (x != Py_NotImplemented) {
711 goto exit_binary_result_object;
714 Py_DECREF_IMMORTAL(x);
717#if PYTHON_VERSION < 0x300
718 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
720 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
723 PyObject *coerced1 = operand1;
724 PyObject *coerced2 = operand2;
726 int err = c1(&coerced1, &coerced2);
728 if (unlikely(err < 0)) {
729 goto exit_binary_exception;
733 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
735 if (likely(mv == NULL)) {
736 binaryfunc slot = mv->nb_multiply;
738 if (likely(slot != NULL)) {
739 PyObject *x = slot(coerced1, coerced2);
745 goto exit_binary_result_object;
754 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
757 PyObject *coerced1 = operand1;
758 PyObject *coerced2 = operand2;
760 int err = c2(&coerced2, &coerced1);
762 if (unlikely(err < 0)) {
763 goto exit_binary_exception;
767 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
769 if (likely(mv == NULL)) {
770 binaryfunc slot = mv->nb_multiply;
772 if (likely(slot != NULL)) {
773 PyObject *x = slot(coerced1, coerced2);
779 goto exit_binary_result_object;
793 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
795 if (sq_slot != NULL) {
796 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
799 goto exit_binary_result_object;
804 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'int'", type1->tp_name);
805 goto exit_binary_exception;
807exit_binary_result_object:
808 if (unlikely(obj_result == NULL)) {
809 return NUITKA_BOOL_EXCEPTION;
813 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
814 Py_DECREF(obj_result);
818exit_binary_exception:
819 return NUITKA_BOOL_EXCEPTION;
821static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
822 CHECK_OBJECT(operand1);
823 CHECK_OBJECT(operand2);
824 assert(PyInt_CheckExact(operand2));
826 PyTypeObject *type1 = Py_TYPE(operand1);
828 if (type1 == &PyInt_Type) {
836#pragma warning(disable : 4101)
838 NUITKA_MAY_BE_UNUSED
bool cbool_result;
839 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
840 NUITKA_MAY_BE_UNUSED
long clong_result;
841 NUITKA_MAY_BE_UNUSED
double cfloat_result;
846 CHECK_OBJECT(operand1);
847 assert(PyInt_CheckExact(operand1));
848 CHECK_OBJECT(operand2);
849 assert(PyInt_CheckExact(operand2));
851 const long a = PyInt_AS_LONG(operand1);
852 const long b = PyInt_AS_LONG(operand2);
854 const long longprod = (long)((
unsigned long)a * b);
855 const double doubleprod = (double)a * (
double)b;
856 const double doubled_longprod = (double)longprod;
858 if (likely(doubled_longprod == doubleprod)) {
859 clong_result = longprod;
860 goto exit_result_ok_clong;
862 const double diff = doubled_longprod - doubleprod;
863 const double absdiff = diff >= 0.0 ? diff : -diff;
864 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
866 if (likely(32.0 * absdiff <= absprod)) {
867 clong_result = longprod;
868 goto exit_result_ok_clong;
873 PyObject *operand1_object = operand1;
874 PyObject *operand2_object = operand2;
876 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
877 assert(r != Py_NotImplemented);
880 goto exit_result_object;
883 exit_result_ok_clong:
884 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
888 if (unlikely(obj_result == NULL)) {
889 goto exit_result_exception;
891 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
892 Py_DECREF(obj_result);
898 exit_result_exception:
899 return NUITKA_BOOL_EXCEPTION;
902 return __BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(operand1, operand2);
905nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
906 return _BINARY_OPERATION_MULT_NBOOL_OBJECT_INT(operand1, operand2);
910#if PYTHON_VERSION < 0x300
912static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1,
913 PyObject *operand2) {
914 PyTypeObject *type2 = Py_TYPE(operand2);
918#pragma warning(disable : 4101)
920 NUITKA_MAY_BE_UNUSED
bool cbool_result;
921 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
926 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_multiply;
927 binaryfunc slot2 = NULL;
929 if (!(&PyInt_Type == type2)) {
932 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
934 if (slot1 == slot2) {
941 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
942 PyObject *x = slot2(operand1, operand2);
944 if (x != Py_NotImplemented) {
946 goto exit_binary_result_object;
949 Py_DECREF_IMMORTAL(x);
954 PyObject *x = slot1(operand1, operand2);
956 if (x != Py_NotImplemented) {
958 goto exit_binary_result_object;
961 Py_DECREF_IMMORTAL(x);
965 PyObject *x = slot2(operand1, operand2);
967 if (x != Py_NotImplemented) {
969 goto exit_binary_result_object;
972 Py_DECREF_IMMORTAL(x);
975#if PYTHON_VERSION < 0x300
976 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
977 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
980 PyObject *coerced1 = operand1;
981 PyObject *coerced2 = operand2;
983 int err = c1(&coerced1, &coerced2);
985 if (unlikely(err < 0)) {
986 goto exit_binary_exception;
990 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
992 if (likely(mv == NULL)) {
993 binaryfunc slot = mv->nb_multiply;
995 if (likely(slot != NULL)) {
996 PyObject *x = slot(coerced1, coerced2);
1002 goto exit_binary_result_object;
1007 Py_DECREF(coerced1);
1008 Py_DECREF(coerced2);
1012 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1015 PyObject *coerced1 = operand1;
1016 PyObject *coerced2 = operand2;
1018 int err = c2(&coerced2, &coerced1);
1020 if (unlikely(err < 0)) {
1021 goto exit_binary_exception;
1025 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1027 if (likely(mv == NULL)) {
1028 binaryfunc slot = mv->nb_multiply;
1030 if (likely(slot != NULL)) {
1031 PyObject *x = slot(coerced1, coerced2);
1033 Py_DECREF(coerced1);
1034 Py_DECREF(coerced2);
1037 goto exit_binary_result_object;
1042 Py_DECREF(coerced1);
1043 Py_DECREF(coerced2);
1054 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
1056 if (sq_slot != NULL) {
1057 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
1059 obj_result = result;
1060 goto exit_binary_result_object;
1064 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'int' and '%s'", type2->tp_name);
1065 goto exit_binary_exception;
1067exit_binary_result_object:
1068 if (unlikely(obj_result == NULL)) {
1069 return NUITKA_BOOL_EXCEPTION;
1073 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1074 Py_DECREF(obj_result);
1078exit_binary_exception:
1079 return NUITKA_BOOL_EXCEPTION;
1081static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1082 CHECK_OBJECT(operand1);
1083 assert(PyInt_CheckExact(operand1));
1084 CHECK_OBJECT(operand2);
1086 PyTypeObject *type2 = Py_TYPE(operand2);
1088 if (&PyInt_Type == type2) {
1094#if defined(_MSC_VER)
1095#pragma warning(push)
1096#pragma warning(disable : 4101)
1098 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1099 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1100 NUITKA_MAY_BE_UNUSED
long clong_result;
1101 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1102#if defined(_MSC_VER)
1106 CHECK_OBJECT(operand1);
1107 assert(PyInt_CheckExact(operand1));
1108 CHECK_OBJECT(operand2);
1109 assert(PyInt_CheckExact(operand2));
1111 const long a = PyInt_AS_LONG(operand1);
1112 const long b = PyInt_AS_LONG(operand2);
1114 const long longprod = (long)((
unsigned long)a * b);
1115 const double doubleprod = (double)a * (
double)b;
1116 const double doubled_longprod = (double)longprod;
1118 if (likely(doubled_longprod == doubleprod)) {
1119 clong_result = longprod;
1120 goto exit_result_ok_clong;
1122 const double diff = doubled_longprod - doubleprod;
1123 const double absdiff = diff >= 0.0 ? diff : -diff;
1124 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
1126 if (likely(32.0 * absdiff <= absprod)) {
1127 clong_result = longprod;
1128 goto exit_result_ok_clong;
1133 PyObject *operand1_object = operand1;
1134 PyObject *operand2_object = operand2;
1136 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
1137 assert(r != Py_NotImplemented);
1140 goto exit_result_object;
1143 exit_result_ok_clong:
1144 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1145 goto exit_result_ok;
1148 if (unlikely(obj_result == NULL)) {
1149 goto exit_result_exception;
1151 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1152 Py_DECREF(obj_result);
1153 goto exit_result_ok;
1158 exit_result_exception:
1159 return NUITKA_BOOL_EXCEPTION;
1162 return __BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(operand1, operand2);
1165nuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
1166 return _BINARY_OPERATION_MULT_NBOOL_INT_OBJECT(operand1, operand2);
1171static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1172 CHECK_OBJECT(operand1);
1173 assert(PyLong_CheckExact(operand1));
1174 CHECK_OBJECT(operand2);
1175 assert(PyLong_CheckExact(operand2));
1180#if defined(_MSC_VER)
1181#pragma warning(push)
1182#pragma warning(disable : 4101)
1184 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1185 NUITKA_MAY_BE_UNUSED
long clong_result;
1186#if defined(_MSC_VER)
1190 PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);
1191 assert(x != Py_NotImplemented);
1194 goto exit_result_object;
1197 if (unlikely(obj_result == NULL)) {
1198 goto exit_result_exception;
1200 result = obj_result;
1201 goto exit_result_ok;
1206exit_result_exception:
1210PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1211 return _BINARY_OPERATION_MULT_OBJECT_LONG_LONG(operand1, operand2);
1215static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1,
1216 PyObject *operand2) {
1217 PyTypeObject *type1 = Py_TYPE(operand1);
1219#if defined(_MSC_VER)
1220#pragma warning(push)
1221#pragma warning(disable : 4101)
1223 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1224 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1225#if defined(_MSC_VER)
1230 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
1231 binaryfunc slot2 = NULL;
1233 if (!(type1 == &PyLong_Type)) {
1236 slot2 = PyLong_Type.tp_as_number->nb_multiply;
1238 if (slot1 == slot2) {
1243 if (slot1 != NULL) {
1244 PyObject *x = slot1(operand1, operand2);
1246 if (x != Py_NotImplemented) {
1248 goto exit_binary_result_object;
1251 Py_DECREF_IMMORTAL(x);
1254 if (slot2 != NULL) {
1255 PyObject *x = slot2(operand1, operand2);
1257 if (x != Py_NotImplemented) {
1259 goto exit_binary_result_object;
1262 Py_DECREF_IMMORTAL(x);
1265#if PYTHON_VERSION < 0x300
1266 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1268 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1271 PyObject *coerced1 = operand1;
1272 PyObject *coerced2 = operand2;
1274 int err = c1(&coerced1, &coerced2);
1276 if (unlikely(err < 0)) {
1277 goto exit_binary_exception;
1281 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1283 if (likely(mv == NULL)) {
1284 binaryfunc slot = mv->nb_multiply;
1286 if (likely(slot != NULL)) {
1287 PyObject *x = slot(coerced1, coerced2);
1289 Py_DECREF(coerced1);
1290 Py_DECREF(coerced2);
1293 goto exit_binary_result_object;
1298 Py_DECREF(coerced1);
1299 Py_DECREF(coerced2);
1302 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
1305 PyObject *coerced1 = operand1;
1306 PyObject *coerced2 = operand2;
1308 int err = c2(&coerced2, &coerced1);
1310 if (unlikely(err < 0)) {
1311 goto exit_binary_exception;
1315 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1317 if (likely(mv == NULL)) {
1318 binaryfunc slot = mv->nb_multiply;
1320 if (likely(slot != NULL)) {
1321 PyObject *x = slot(coerced1, coerced2);
1323 Py_DECREF(coerced1);
1324 Py_DECREF(coerced2);
1327 goto exit_binary_result_object;
1332 Py_DECREF(coerced1);
1333 Py_DECREF(coerced2);
1341 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
1343 if (sq_slot != NULL) {
1344 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
1346 obj_result = result;
1347 goto exit_binary_result_object;
1352#if PYTHON_VERSION < 0x300
1353 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'long'", type1->tp_name);
1355 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'int'", type1->tp_name);
1357 goto exit_binary_exception;
1359exit_binary_result_object:
1362exit_binary_exception:
1365static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1366 CHECK_OBJECT(operand1);
1367 CHECK_OBJECT(operand2);
1368 assert(PyLong_CheckExact(operand2));
1370 PyTypeObject *type1 = Py_TYPE(operand1);
1372 if (type1 == &PyLong_Type) {
1378#if defined(_MSC_VER)
1379#pragma warning(push)
1380#pragma warning(disable : 4101)
1382 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1383 NUITKA_MAY_BE_UNUSED
long clong_result;
1384#if defined(_MSC_VER)
1388 PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);
1389 assert(x != Py_NotImplemented);
1392 goto exit_result_object;
1395 if (unlikely(obj_result == NULL)) {
1396 goto exit_result_exception;
1398 result = obj_result;
1399 goto exit_result_ok;
1404 exit_result_exception:
1408 return __BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(operand1, operand2);
1411PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1412 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_LONG(operand1, operand2);
1416static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1,
1417 PyObject *operand2) {
1418 PyTypeObject *type2 = Py_TYPE(operand2);
1420#if defined(_MSC_VER)
1421#pragma warning(push)
1422#pragma warning(disable : 4101)
1424 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1425 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1426#if defined(_MSC_VER)
1430 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;
1431 binaryfunc slot2 = NULL;
1433 if (!(&PyLong_Type == type2)) {
1436 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
1438 if (slot1 == slot2) {
1443 if (slot1 != NULL) {
1444 if (slot2 != NULL) {
1445 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
1446 PyObject *x = slot2(operand1, operand2);
1448 if (x != Py_NotImplemented) {
1450 goto exit_binary_result_object;
1453 Py_DECREF_IMMORTAL(x);
1458 PyObject *x = slot1(operand1, operand2);
1460 if (x != Py_NotImplemented) {
1462 goto exit_binary_result_object;
1465 Py_DECREF_IMMORTAL(x);
1468 if (slot2 != NULL) {
1469 PyObject *x = slot2(operand1, operand2);
1471 if (x != Py_NotImplemented) {
1473 goto exit_binary_result_object;
1476 Py_DECREF_IMMORTAL(x);
1479#if PYTHON_VERSION < 0x300
1480 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1481 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
1484 PyObject *coerced1 = operand1;
1485 PyObject *coerced2 = operand2;
1487 int err = c1(&coerced1, &coerced2);
1489 if (unlikely(err < 0)) {
1490 goto exit_binary_exception;
1494 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1496 if (likely(mv == NULL)) {
1497 binaryfunc slot = mv->nb_multiply;
1499 if (likely(slot != NULL)) {
1500 PyObject *x = slot(coerced1, coerced2);
1502 Py_DECREF(coerced1);
1503 Py_DECREF(coerced2);
1506 goto exit_binary_result_object;
1511 Py_DECREF(coerced1);
1512 Py_DECREF(coerced2);
1516 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1519 PyObject *coerced1 = operand1;
1520 PyObject *coerced2 = operand2;
1522 int err = c2(&coerced2, &coerced1);
1524 if (unlikely(err < 0)) {
1525 goto exit_binary_exception;
1529 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1531 if (likely(mv == NULL)) {
1532 binaryfunc slot = mv->nb_multiply;
1534 if (likely(slot != NULL)) {
1535 PyObject *x = slot(coerced1, coerced2);
1537 Py_DECREF(coerced1);
1538 Py_DECREF(coerced2);
1541 goto exit_binary_result_object;
1546 Py_DECREF(coerced1);
1547 Py_DECREF(coerced2);
1558 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
1560 if (sq_slot != NULL) {
1561 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
1563 obj_result = result;
1564 goto exit_binary_result_object;
1568#if PYTHON_VERSION < 0x300
1569 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'long' and '%s'", type2->tp_name);
1571 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'int' and '%s'", type2->tp_name);
1573 goto exit_binary_exception;
1575exit_binary_result_object:
1578exit_binary_exception:
1581static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1582 CHECK_OBJECT(operand1);
1583 assert(PyLong_CheckExact(operand1));
1584 CHECK_OBJECT(operand2);
1586 PyTypeObject *type2 = Py_TYPE(operand2);
1588 if (&PyLong_Type == type2) {
1594#if defined(_MSC_VER)
1595#pragma warning(push)
1596#pragma warning(disable : 4101)
1598 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1599 NUITKA_MAY_BE_UNUSED
long clong_result;
1600#if defined(_MSC_VER)
1604 PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);
1605 assert(x != Py_NotImplemented);
1608 goto exit_result_object;
1611 if (unlikely(obj_result == NULL)) {
1612 goto exit_result_exception;
1614 result = obj_result;
1615 goto exit_result_ok;
1620 exit_result_exception:
1624 return __BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(operand1, operand2);
1627PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1628 return _BINARY_OPERATION_MULT_OBJECT_LONG_OBJECT(operand1, operand2);
1632static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1633 CHECK_OBJECT(operand1);
1634 assert(PyLong_CheckExact(operand1));
1635 CHECK_OBJECT(operand2);
1636 assert(PyLong_CheckExact(operand2));
1641#if defined(_MSC_VER)
1642#pragma warning(push)
1643#pragma warning(disable : 4101)
1645 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1646 NUITKA_MAY_BE_UNUSED
long clong_result;
1647#if defined(_MSC_VER)
1651 PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);
1652 assert(x != Py_NotImplemented);
1655 goto exit_result_object;
1658 if (unlikely(obj_result == NULL)) {
1659 goto exit_result_exception;
1661 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1662 Py_DECREF(obj_result);
1663 goto exit_result_ok;
1668exit_result_exception:
1669 return NUITKA_BOOL_EXCEPTION;
1672nuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2) {
1673 return _BINARY_OPERATION_MULT_NBOOL_LONG_LONG(operand1, operand2);
1677static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1,
1678 PyObject *operand2) {
1679 PyTypeObject *type1 = Py_TYPE(operand1);
1681#if defined(_MSC_VER)
1682#pragma warning(push)
1683#pragma warning(disable : 4101)
1685 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1686 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1687#if defined(_MSC_VER)
1692 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
1693 binaryfunc slot2 = NULL;
1695 if (!(type1 == &PyLong_Type)) {
1698 slot2 = PyLong_Type.tp_as_number->nb_multiply;
1700 if (slot1 == slot2) {
1705 if (slot1 != NULL) {
1706 PyObject *x = slot1(operand1, operand2);
1708 if (x != Py_NotImplemented) {
1710 goto exit_binary_result_object;
1713 Py_DECREF_IMMORTAL(x);
1716 if (slot2 != NULL) {
1717 PyObject *x = slot2(operand1, operand2);
1719 if (x != Py_NotImplemented) {
1721 goto exit_binary_result_object;
1724 Py_DECREF_IMMORTAL(x);
1727#if PYTHON_VERSION < 0x300
1728 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1730 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1733 PyObject *coerced1 = operand1;
1734 PyObject *coerced2 = operand2;
1736 int err = c1(&coerced1, &coerced2);
1738 if (unlikely(err < 0)) {
1739 goto exit_binary_exception;
1743 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1745 if (likely(mv == NULL)) {
1746 binaryfunc slot = mv->nb_multiply;
1748 if (likely(slot != NULL)) {
1749 PyObject *x = slot(coerced1, coerced2);
1751 Py_DECREF(coerced1);
1752 Py_DECREF(coerced2);
1755 goto exit_binary_result_object;
1760 Py_DECREF(coerced1);
1761 Py_DECREF(coerced2);
1764 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
1767 PyObject *coerced1 = operand1;
1768 PyObject *coerced2 = operand2;
1770 int err = c2(&coerced2, &coerced1);
1772 if (unlikely(err < 0)) {
1773 goto exit_binary_exception;
1777 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1779 if (likely(mv == NULL)) {
1780 binaryfunc slot = mv->nb_multiply;
1782 if (likely(slot != NULL)) {
1783 PyObject *x = slot(coerced1, coerced2);
1785 Py_DECREF(coerced1);
1786 Py_DECREF(coerced2);
1789 goto exit_binary_result_object;
1794 Py_DECREF(coerced1);
1795 Py_DECREF(coerced2);
1803 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
1805 if (sq_slot != NULL) {
1806 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
1808 obj_result = result;
1809 goto exit_binary_result_object;
1814#if PYTHON_VERSION < 0x300
1815 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'long'", type1->tp_name);
1817 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'int'", type1->tp_name);
1819 goto exit_binary_exception;
1821exit_binary_result_object:
1822 if (unlikely(obj_result == NULL)) {
1823 return NUITKA_BOOL_EXCEPTION;
1827 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1828 Py_DECREF(obj_result);
1832exit_binary_exception:
1833 return NUITKA_BOOL_EXCEPTION;
1835static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1836 CHECK_OBJECT(operand1);
1837 CHECK_OBJECT(operand2);
1838 assert(PyLong_CheckExact(operand2));
1840 PyTypeObject *type1 = Py_TYPE(operand1);
1842 if (type1 == &PyLong_Type) {
1848#if defined(_MSC_VER)
1849#pragma warning(push)
1850#pragma warning(disable : 4101)
1852 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1853 NUITKA_MAY_BE_UNUSED
long clong_result;
1854#if defined(_MSC_VER)
1858 PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);
1859 assert(x != Py_NotImplemented);
1862 goto exit_result_object;
1865 if (unlikely(obj_result == NULL)) {
1866 goto exit_result_exception;
1868 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
1869 Py_DECREF(obj_result);
1870 goto exit_result_ok;
1875 exit_result_exception:
1876 return NUITKA_BOOL_EXCEPTION;
1879 return __BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(operand1, operand2);
1882nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
1883 return _BINARY_OPERATION_MULT_NBOOL_OBJECT_LONG(operand1, operand2);
1887static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1,
1888 PyObject *operand2) {
1889 PyTypeObject *type2 = Py_TYPE(operand2);
1891#if defined(_MSC_VER)
1892#pragma warning(push)
1893#pragma warning(disable : 4101)
1895 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1896 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1897#if defined(_MSC_VER)
1901 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;
1902 binaryfunc slot2 = NULL;
1904 if (!(&PyLong_Type == type2)) {
1907 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
1909 if (slot1 == slot2) {
1914 if (slot1 != NULL) {
1915 if (slot2 != NULL) {
1916 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
1917 PyObject *x = slot2(operand1, operand2);
1919 if (x != Py_NotImplemented) {
1921 goto exit_binary_result_object;
1924 Py_DECREF_IMMORTAL(x);
1929 PyObject *x = slot1(operand1, operand2);
1931 if (x != Py_NotImplemented) {
1933 goto exit_binary_result_object;
1936 Py_DECREF_IMMORTAL(x);
1939 if (slot2 != NULL) {
1940 PyObject *x = slot2(operand1, operand2);
1942 if (x != Py_NotImplemented) {
1944 goto exit_binary_result_object;
1947 Py_DECREF_IMMORTAL(x);
1950#if PYTHON_VERSION < 0x300
1951 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1952 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
1955 PyObject *coerced1 = operand1;
1956 PyObject *coerced2 = operand2;
1958 int err = c1(&coerced1, &coerced2);
1960 if (unlikely(err < 0)) {
1961 goto exit_binary_exception;
1965 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1967 if (likely(mv == NULL)) {
1968 binaryfunc slot = mv->nb_multiply;
1970 if (likely(slot != NULL)) {
1971 PyObject *x = slot(coerced1, coerced2);
1973 Py_DECREF(coerced1);
1974 Py_DECREF(coerced2);
1977 goto exit_binary_result_object;
1982 Py_DECREF(coerced1);
1983 Py_DECREF(coerced2);
1987 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1990 PyObject *coerced1 = operand1;
1991 PyObject *coerced2 = operand2;
1993 int err = c2(&coerced2, &coerced1);
1995 if (unlikely(err < 0)) {
1996 goto exit_binary_exception;
2000 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2002 if (likely(mv == NULL)) {
2003 binaryfunc slot = mv->nb_multiply;
2005 if (likely(slot != NULL)) {
2006 PyObject *x = slot(coerced1, coerced2);
2008 Py_DECREF(coerced1);
2009 Py_DECREF(coerced2);
2012 goto exit_binary_result_object;
2017 Py_DECREF(coerced1);
2018 Py_DECREF(coerced2);
2029 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
2031 if (sq_slot != NULL) {
2032 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
2034 obj_result = result;
2035 goto exit_binary_result_object;
2039#if PYTHON_VERSION < 0x300
2040 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'long' and '%s'", type2->tp_name);
2042 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'int' and '%s'", type2->tp_name);
2044 goto exit_binary_exception;
2046exit_binary_result_object:
2047 if (unlikely(obj_result == NULL)) {
2048 return NUITKA_BOOL_EXCEPTION;
2052 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2053 Py_DECREF(obj_result);
2057exit_binary_exception:
2058 return NUITKA_BOOL_EXCEPTION;
2060static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
2061 CHECK_OBJECT(operand1);
2062 assert(PyLong_CheckExact(operand1));
2063 CHECK_OBJECT(operand2);
2065 PyTypeObject *type2 = Py_TYPE(operand2);
2067 if (&PyLong_Type == type2) {
2073#if defined(_MSC_VER)
2074#pragma warning(push)
2075#pragma warning(disable : 4101)
2077 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2078 NUITKA_MAY_BE_UNUSED
long clong_result;
2079#if defined(_MSC_VER)
2083 PyObject *x = PyLong_Type.tp_as_number->nb_multiply(operand1, operand2);
2084 assert(x != Py_NotImplemented);
2087 goto exit_result_object;
2090 if (unlikely(obj_result == NULL)) {
2091 goto exit_result_exception;
2093 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2094 Py_DECREF(obj_result);
2095 goto exit_result_ok;
2100 exit_result_exception:
2101 return NUITKA_BOOL_EXCEPTION;
2104 return __BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(operand1, operand2);
2107nuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
2108 return _BINARY_OPERATION_MULT_NBOOL_LONG_OBJECT(operand1, operand2);
2112static PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2113 CHECK_OBJECT(operand1);
2114 assert(PyFloat_CheckExact(operand1));
2115 CHECK_OBJECT(operand2);
2116 assert(PyFloat_CheckExact(operand2));
2120#if defined(_MSC_VER)
2121#pragma warning(push)
2122#pragma warning(disable : 4101)
2125 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2126 NUITKA_MAY_BE_UNUSED
long clong_result;
2127 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2128#if defined(_MSC_VER)
2132 CHECK_OBJECT(operand1);
2133 assert(PyFloat_CheckExact(operand1));
2134 CHECK_OBJECT(operand2);
2135 assert(PyFloat_CheckExact(operand2));
2137 const double a = PyFloat_AS_DOUBLE(operand1);
2138 const double b = PyFloat_AS_DOUBLE(operand2);
2143 goto exit_result_ok_cfloat;
2145exit_result_ok_cfloat:
2146 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2147 goto exit_result_ok;
2153PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2154 return _BINARY_OPERATION_MULT_OBJECT_FLOAT_FLOAT(operand1, operand2);
2158static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1,
2159 PyObject *operand2) {
2160 PyTypeObject *type1 = Py_TYPE(operand1);
2162#if defined(_MSC_VER)
2163#pragma warning(push)
2164#pragma warning(disable : 4101)
2166 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2167 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2168#if defined(_MSC_VER)
2173 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
2174 binaryfunc slot2 = NULL;
2176 if (!(type1 == &PyFloat_Type)) {
2179 slot2 = PyFloat_Type.tp_as_number->nb_multiply;
2181 if (slot1 == slot2) {
2186 if (slot1 != NULL) {
2187 PyObject *x = slot1(operand1, operand2);
2189 if (x != Py_NotImplemented) {
2191 goto exit_binary_result_object;
2194 Py_DECREF_IMMORTAL(x);
2197 if (slot2 != NULL) {
2198 PyObject *x = slot2(operand1, operand2);
2200 if (x != Py_NotImplemented) {
2202 goto exit_binary_result_object;
2205 Py_DECREF_IMMORTAL(x);
2208#if PYTHON_VERSION < 0x300
2209 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
2211 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2214 PyObject *coerced1 = operand1;
2215 PyObject *coerced2 = operand2;
2217 int err = c1(&coerced1, &coerced2);
2219 if (unlikely(err < 0)) {
2220 goto exit_binary_exception;
2224 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2226 if (likely(mv == NULL)) {
2227 binaryfunc slot = mv->nb_multiply;
2229 if (likely(slot != NULL)) {
2230 PyObject *x = slot(coerced1, coerced2);
2232 Py_DECREF(coerced1);
2233 Py_DECREF(coerced2);
2236 goto exit_binary_result_object;
2241 Py_DECREF(coerced1);
2242 Py_DECREF(coerced2);
2245 coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
2248 PyObject *coerced1 = operand1;
2249 PyObject *coerced2 = operand2;
2251 int err = c2(&coerced2, &coerced1);
2253 if (unlikely(err < 0)) {
2254 goto exit_binary_exception;
2258 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2260 if (likely(mv == NULL)) {
2261 binaryfunc slot = mv->nb_multiply;
2263 if (likely(slot != NULL)) {
2264 PyObject *x = slot(coerced1, coerced2);
2266 Py_DECREF(coerced1);
2267 Py_DECREF(coerced2);
2270 goto exit_binary_result_object;
2275 Py_DECREF(coerced1);
2276 Py_DECREF(coerced2);
2284 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
2286 if (sq_slot != NULL) {
2287 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
2289 obj_result = result;
2290 goto exit_binary_result_object;
2295 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'float'", type1->tp_name);
2296 goto exit_binary_exception;
2298exit_binary_result_object:
2301exit_binary_exception:
2304static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2305 CHECK_OBJECT(operand1);
2306 CHECK_OBJECT(operand2);
2307 assert(PyFloat_CheckExact(operand2));
2309 PyTypeObject *type1 = Py_TYPE(operand1);
2311 if (type1 == &PyFloat_Type) {
2316#if defined(_MSC_VER)
2317#pragma warning(push)
2318#pragma warning(disable : 4101)
2321 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2322 NUITKA_MAY_BE_UNUSED
long clong_result;
2323 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2324#if defined(_MSC_VER)
2328 CHECK_OBJECT(operand1);
2329 assert(PyFloat_CheckExact(operand1));
2330 CHECK_OBJECT(operand2);
2331 assert(PyFloat_CheckExact(operand2));
2333 const double a = PyFloat_AS_DOUBLE(operand1);
2334 const double b = PyFloat_AS_DOUBLE(operand2);
2339 goto exit_result_ok_cfloat;
2341 exit_result_ok_cfloat:
2342 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2343 goto exit_result_ok;
2349 return __BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(operand1, operand2);
2352PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2353 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_FLOAT(operand1, operand2);
2357static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1,
2358 PyObject *operand2) {
2359 PyTypeObject *type2 = Py_TYPE(operand2);
2361#if defined(_MSC_VER)
2362#pragma warning(push)
2363#pragma warning(disable : 4101)
2365 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2366 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2367#if defined(_MSC_VER)
2371 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;
2372 binaryfunc slot2 = NULL;
2374 if (!(&PyFloat_Type == type2)) {
2377 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
2379 if (slot1 == slot2) {
2384 if (slot1 != NULL) {
2385 if (slot2 != NULL) {
2386 if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
2387 PyObject *x = slot2(operand1, operand2);
2389 if (x != Py_NotImplemented) {
2391 goto exit_binary_result_object;
2394 Py_DECREF_IMMORTAL(x);
2399 PyObject *x = slot1(operand1, operand2);
2401 if (x != Py_NotImplemented) {
2403 goto exit_binary_result_object;
2406 Py_DECREF_IMMORTAL(x);
2409 if (slot2 != NULL) {
2410 PyObject *x = slot2(operand1, operand2);
2412 if (x != Py_NotImplemented) {
2414 goto exit_binary_result_object;
2417 Py_DECREF_IMMORTAL(x);
2420#if PYTHON_VERSION < 0x300
2421 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
2422 coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
2425 PyObject *coerced1 = operand1;
2426 PyObject *coerced2 = operand2;
2428 int err = c1(&coerced1, &coerced2);
2430 if (unlikely(err < 0)) {
2431 goto exit_binary_exception;
2435 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2437 if (likely(mv == NULL)) {
2438 binaryfunc slot = mv->nb_multiply;
2440 if (likely(slot != NULL)) {
2441 PyObject *x = slot(coerced1, coerced2);
2443 Py_DECREF(coerced1);
2444 Py_DECREF(coerced2);
2447 goto exit_binary_result_object;
2452 Py_DECREF(coerced1);
2453 Py_DECREF(coerced2);
2457 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2460 PyObject *coerced1 = operand1;
2461 PyObject *coerced2 = operand2;
2463 int err = c2(&coerced2, &coerced1);
2465 if (unlikely(err < 0)) {
2466 goto exit_binary_exception;
2470 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2472 if (likely(mv == NULL)) {
2473 binaryfunc slot = mv->nb_multiply;
2475 if (likely(slot != NULL)) {
2476 PyObject *x = slot(coerced1, coerced2);
2478 Py_DECREF(coerced1);
2479 Py_DECREF(coerced2);
2482 goto exit_binary_result_object;
2487 Py_DECREF(coerced1);
2488 Py_DECREF(coerced2);
2499 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
2501 if (sq_slot != NULL) {
2502 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
2504 obj_result = result;
2505 goto exit_binary_result_object;
2509 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and '%s'", type2->tp_name);
2510 goto exit_binary_exception;
2512exit_binary_result_object:
2515exit_binary_exception:
2518static PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2519 CHECK_OBJECT(operand1);
2520 assert(PyFloat_CheckExact(operand1));
2521 CHECK_OBJECT(operand2);
2523 PyTypeObject *type2 = Py_TYPE(operand2);
2525 if (&PyFloat_Type == type2) {
2530#if defined(_MSC_VER)
2531#pragma warning(push)
2532#pragma warning(disable : 4101)
2535 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2536 NUITKA_MAY_BE_UNUSED
long clong_result;
2537 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2538#if defined(_MSC_VER)
2542 CHECK_OBJECT(operand1);
2543 assert(PyFloat_CheckExact(operand1));
2544 CHECK_OBJECT(operand2);
2545 assert(PyFloat_CheckExact(operand2));
2547 const double a = PyFloat_AS_DOUBLE(operand1);
2548 const double b = PyFloat_AS_DOUBLE(operand2);
2553 goto exit_result_ok_cfloat;
2555 exit_result_ok_cfloat:
2556 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2557 goto exit_result_ok;
2563 return __BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(operand1, operand2);
2566PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2567 return _BINARY_OPERATION_MULT_OBJECT_FLOAT_OBJECT(operand1, operand2);
2571static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2572 CHECK_OBJECT(operand1);
2573 assert(PyFloat_CheckExact(operand1));
2574 CHECK_OBJECT(operand2);
2575 assert(PyFloat_CheckExact(operand2));
2579#if defined(_MSC_VER)
2580#pragma warning(push)
2581#pragma warning(disable : 4101)
2584 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2585 NUITKA_MAY_BE_UNUSED
long clong_result;
2586 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2587#if defined(_MSC_VER)
2591 CHECK_OBJECT(operand1);
2592 assert(PyFloat_CheckExact(operand1));
2593 CHECK_OBJECT(operand2);
2594 assert(PyFloat_CheckExact(operand2));
2596 const double a = PyFloat_AS_DOUBLE(operand1);
2597 const double b = PyFloat_AS_DOUBLE(operand2);
2602 goto exit_result_ok_cfloat;
2604exit_result_ok_cfloat:
2605 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2606 goto exit_result_ok;
2612nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
2613 return _BINARY_OPERATION_MULT_NBOOL_FLOAT_FLOAT(operand1, operand2);
2617static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1,
2618 PyObject *operand2) {
2619 PyTypeObject *type1 = Py_TYPE(operand1);
2621#if defined(_MSC_VER)
2622#pragma warning(push)
2623#pragma warning(disable : 4101)
2625 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2626 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2627#if defined(_MSC_VER)
2632 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
2633 binaryfunc slot2 = NULL;
2635 if (!(type1 == &PyFloat_Type)) {
2638 slot2 = PyFloat_Type.tp_as_number->nb_multiply;
2640 if (slot1 == slot2) {
2645 if (slot1 != NULL) {
2646 PyObject *x = slot1(operand1, operand2);
2648 if (x != Py_NotImplemented) {
2650 goto exit_binary_result_object;
2653 Py_DECREF_IMMORTAL(x);
2656 if (slot2 != NULL) {
2657 PyObject *x = slot2(operand1, operand2);
2659 if (x != Py_NotImplemented) {
2661 goto exit_binary_result_object;
2664 Py_DECREF_IMMORTAL(x);
2667#if PYTHON_VERSION < 0x300
2668 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
2670 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2673 PyObject *coerced1 = operand1;
2674 PyObject *coerced2 = operand2;
2676 int err = c1(&coerced1, &coerced2);
2678 if (unlikely(err < 0)) {
2679 goto exit_binary_exception;
2683 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2685 if (likely(mv == NULL)) {
2686 binaryfunc slot = mv->nb_multiply;
2688 if (likely(slot != NULL)) {
2689 PyObject *x = slot(coerced1, coerced2);
2691 Py_DECREF(coerced1);
2692 Py_DECREF(coerced2);
2695 goto exit_binary_result_object;
2700 Py_DECREF(coerced1);
2701 Py_DECREF(coerced2);
2704 coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
2707 PyObject *coerced1 = operand1;
2708 PyObject *coerced2 = operand2;
2710 int err = c2(&coerced2, &coerced1);
2712 if (unlikely(err < 0)) {
2713 goto exit_binary_exception;
2717 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2719 if (likely(mv == NULL)) {
2720 binaryfunc slot = mv->nb_multiply;
2722 if (likely(slot != NULL)) {
2723 PyObject *x = slot(coerced1, coerced2);
2725 Py_DECREF(coerced1);
2726 Py_DECREF(coerced2);
2729 goto exit_binary_result_object;
2734 Py_DECREF(coerced1);
2735 Py_DECREF(coerced2);
2743 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
2745 if (sq_slot != NULL) {
2746 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
2748 obj_result = result;
2749 goto exit_binary_result_object;
2754 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and 'float'", type1->tp_name);
2755 goto exit_binary_exception;
2757exit_binary_result_object:
2758 if (unlikely(obj_result == NULL)) {
2759 return NUITKA_BOOL_EXCEPTION;
2763 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2764 Py_DECREF(obj_result);
2768exit_binary_exception:
2769 return NUITKA_BOOL_EXCEPTION;
2771static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2772 CHECK_OBJECT(operand1);
2773 CHECK_OBJECT(operand2);
2774 assert(PyFloat_CheckExact(operand2));
2776 PyTypeObject *type1 = Py_TYPE(operand1);
2778 if (type1 == &PyFloat_Type) {
2783#if defined(_MSC_VER)
2784#pragma warning(push)
2785#pragma warning(disable : 4101)
2788 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2789 NUITKA_MAY_BE_UNUSED
long clong_result;
2790 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2791#if defined(_MSC_VER)
2795 CHECK_OBJECT(operand1);
2796 assert(PyFloat_CheckExact(operand1));
2797 CHECK_OBJECT(operand2);
2798 assert(PyFloat_CheckExact(operand2));
2800 const double a = PyFloat_AS_DOUBLE(operand1);
2801 const double b = PyFloat_AS_DOUBLE(operand2);
2806 goto exit_result_ok_cfloat;
2808 exit_result_ok_cfloat:
2809 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2810 goto exit_result_ok;
2816 return __BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(operand1, operand2);
2819nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
2820 return _BINARY_OPERATION_MULT_NBOOL_OBJECT_FLOAT(operand1, operand2);
2824static HEDLEY_NEVER_INLINE nuitka_bool __BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1,
2825 PyObject *operand2) {
2826 PyTypeObject *type2 = Py_TYPE(operand2);
2828#if defined(_MSC_VER)
2829#pragma warning(push)
2830#pragma warning(disable : 4101)
2832 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2833 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2834#if defined(_MSC_VER)
2838 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;
2839 binaryfunc slot2 = NULL;
2841 if (!(&PyFloat_Type == type2)) {
2844 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
2846 if (slot1 == slot2) {
2851 if (slot1 != NULL) {
2852 if (slot2 != NULL) {
2853 if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
2854 PyObject *x = slot2(operand1, operand2);
2856 if (x != Py_NotImplemented) {
2858 goto exit_binary_result_object;
2861 Py_DECREF_IMMORTAL(x);
2866 PyObject *x = slot1(operand1, operand2);
2868 if (x != Py_NotImplemented) {
2870 goto exit_binary_result_object;
2873 Py_DECREF_IMMORTAL(x);
2876 if (slot2 != NULL) {
2877 PyObject *x = slot2(operand1, operand2);
2879 if (x != Py_NotImplemented) {
2881 goto exit_binary_result_object;
2884 Py_DECREF_IMMORTAL(x);
2887#if PYTHON_VERSION < 0x300
2888 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
2889 coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
2892 PyObject *coerced1 = operand1;
2893 PyObject *coerced2 = operand2;
2895 int err = c1(&coerced1, &coerced2);
2897 if (unlikely(err < 0)) {
2898 goto exit_binary_exception;
2902 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2904 if (likely(mv == NULL)) {
2905 binaryfunc slot = mv->nb_multiply;
2907 if (likely(slot != NULL)) {
2908 PyObject *x = slot(coerced1, coerced2);
2910 Py_DECREF(coerced1);
2911 Py_DECREF(coerced2);
2914 goto exit_binary_result_object;
2919 Py_DECREF(coerced1);
2920 Py_DECREF(coerced2);
2924 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2927 PyObject *coerced1 = operand1;
2928 PyObject *coerced2 = operand2;
2930 int err = c2(&coerced2, &coerced1);
2932 if (unlikely(err < 0)) {
2933 goto exit_binary_exception;
2937 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2939 if (likely(mv == NULL)) {
2940 binaryfunc slot = mv->nb_multiply;
2942 if (likely(slot != NULL)) {
2943 PyObject *x = slot(coerced1, coerced2);
2945 Py_DECREF(coerced1);
2946 Py_DECREF(coerced2);
2949 goto exit_binary_result_object;
2954 Py_DECREF(coerced1);
2955 Py_DECREF(coerced2);
2966 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
2968 if (sq_slot != NULL) {
2969 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
2971 obj_result = result;
2972 goto exit_binary_result_object;
2976 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and '%s'", type2->tp_name);
2977 goto exit_binary_exception;
2979exit_binary_result_object:
2980 if (unlikely(obj_result == NULL)) {
2981 return NUITKA_BOOL_EXCEPTION;
2985 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
2986 Py_DECREF(obj_result);
2990exit_binary_exception:
2991 return NUITKA_BOOL_EXCEPTION;
2993static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
2994 CHECK_OBJECT(operand1);
2995 assert(PyFloat_CheckExact(operand1));
2996 CHECK_OBJECT(operand2);
2998 PyTypeObject *type2 = Py_TYPE(operand2);
3000 if (&PyFloat_Type == type2) {
3005#if defined(_MSC_VER)
3006#pragma warning(push)
3007#pragma warning(disable : 4101)
3010 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3011 NUITKA_MAY_BE_UNUSED
long clong_result;
3012 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3013#if defined(_MSC_VER)
3017 CHECK_OBJECT(operand1);
3018 assert(PyFloat_CheckExact(operand1));
3019 CHECK_OBJECT(operand2);
3020 assert(PyFloat_CheckExact(operand2));
3022 const double a = PyFloat_AS_DOUBLE(operand1);
3023 const double b = PyFloat_AS_DOUBLE(operand2);
3028 goto exit_result_ok_cfloat;
3030 exit_result_ok_cfloat:
3031 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3032 goto exit_result_ok;
3038 return __BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(operand1, operand2);
3041nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
3042 return _BINARY_OPERATION_MULT_NBOOL_FLOAT_OBJECT(operand1, operand2);
3046static PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3047 CHECK_OBJECT(operand1);
3048 assert(PyFloat_CheckExact(operand1));
3049 CHECK_OBJECT(operand2);
3050 assert(PyLong_CheckExact(operand2));
3052#if defined(_MSC_VER)
3053#pragma warning(push)
3054#pragma warning(disable : 4101)
3056 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3057 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3058#if defined(_MSC_VER)
3062 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;
3065 if (slot1 != NULL) {
3066 PyObject *x = slot1(operand1, operand2);
3068 if (x != Py_NotImplemented) {
3070 goto exit_binary_result_object;
3073 Py_DECREF_IMMORTAL(x);
3083#if PYTHON_VERSION < 0x300
3084 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and 'long'");
3086 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and 'int'");
3088 goto exit_binary_exception;
3090exit_binary_result_object:
3093exit_binary_exception:
3097PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3098 return _BINARY_OPERATION_MULT_OBJECT_FLOAT_LONG(operand1, operand2);
3102static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3103 CHECK_OBJECT(operand1);
3104 assert(PyFloat_CheckExact(operand1));
3105 CHECK_OBJECT(operand2);
3106 assert(PyLong_CheckExact(operand2));
3108#if defined(_MSC_VER)
3109#pragma warning(push)
3110#pragma warning(disable : 4101)
3112 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3113 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3114#if defined(_MSC_VER)
3118 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;
3121 if (slot1 != NULL) {
3122 PyObject *x = slot1(operand1, operand2);
3124 if (x != Py_NotImplemented) {
3126 goto exit_binary_result_object;
3129 Py_DECREF_IMMORTAL(x);
3139#if PYTHON_VERSION < 0x300
3140 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and 'long'");
3142 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and 'int'");
3144 goto exit_binary_exception;
3146exit_binary_result_object:
3147 if (unlikely(obj_result == NULL)) {
3148 return NUITKA_BOOL_EXCEPTION;
3152 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3153 Py_DECREF(obj_result);
3157exit_binary_exception:
3158 return NUITKA_BOOL_EXCEPTION;
3161nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
3162 return _BINARY_OPERATION_MULT_NBOOL_FLOAT_LONG(operand1, operand2);
3165#if PYTHON_VERSION < 0x300
3167static PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3168 CHECK_OBJECT(operand1);
3169 assert(PyFloat_CheckExact(operand1));
3170 CHECK_OBJECT(operand2);
3171 assert(PyInt_CheckExact(operand2));
3173#if defined(_MSC_VER)
3174#pragma warning(push)
3175#pragma warning(disable : 4101)
3177 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3178 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3179#if defined(_MSC_VER)
3183 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;
3186 if (slot1 != NULL) {
3187 PyObject *x = slot1(operand1, operand2);
3189 if (x != Py_NotImplemented) {
3191 goto exit_binary_result_object;
3194 Py_DECREF_IMMORTAL(x);
3204 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'float' and 'int'");
3205 goto exit_binary_exception;
3207exit_binary_result_object:
3210exit_binary_exception:
3214PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3215 return _BINARY_OPERATION_MULT_OBJECT_FLOAT_INT(operand1, operand2);
3219#if PYTHON_VERSION < 0x300
3221static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3222 CHECK_OBJECT(operand1);
3223 assert(PyFloat_CheckExact(operand1));
3224 CHECK_OBJECT(operand2);
3225 assert(PyInt_CheckExact(operand2));
3227#if defined(_MSC_VER)
3228#pragma warning(push)
3229#pragma warning(disable : 4101)
3231 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3232 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3233#if defined(_MSC_VER)
3237 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_multiply;
3240 if (slot1 != NULL) {
3241 PyObject *x = slot1(operand1, operand2);
3243 if (x != Py_NotImplemented) {
3245 goto exit_binary_result_object;
3248 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:
3262 if (unlikely(obj_result == NULL)) {
3263 return NUITKA_BOOL_EXCEPTION;
3267 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3268 Py_DECREF(obj_result);
3272exit_binary_exception:
3273 return NUITKA_BOOL_EXCEPTION;
3276nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
3277 return _BINARY_OPERATION_MULT_NBOOL_FLOAT_INT(operand1, operand2);
3281#if PYTHON_VERSION < 0x300
3283static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
3284 CHECK_OBJECT(operand1);
3285 assert(PyLong_CheckExact(operand1));
3286 CHECK_OBJECT(operand2);
3287 assert(PyInt_CheckExact(operand2));
3289#if defined(_MSC_VER)
3290#pragma warning(push)
3291#pragma warning(disable : 4101)
3293 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3294 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3295#if defined(_MSC_VER)
3299 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;
3302 if (slot1 != NULL) {
3303 PyObject *x = slot1(operand1, operand2);
3305 if (x != Py_NotImplemented) {
3307 goto exit_binary_result_object;
3310 Py_DECREF_IMMORTAL(x);
3320 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'long' and 'int'");
3321 goto exit_binary_exception;
3323exit_binary_result_object:
3326exit_binary_exception:
3330PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
3331 return _BINARY_OPERATION_MULT_OBJECT_LONG_INT(operand1, operand2);
3335#if PYTHON_VERSION < 0x300
3337static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
3338 CHECK_OBJECT(operand1);
3339 assert(PyLong_CheckExact(operand1));
3340 CHECK_OBJECT(operand2);
3341 assert(PyInt_CheckExact(operand2));
3343#if defined(_MSC_VER)
3344#pragma warning(push)
3345#pragma warning(disable : 4101)
3347 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3348 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3349#if defined(_MSC_VER)
3353 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_multiply;
3356 if (slot1 != NULL) {
3357 PyObject *x = slot1(operand1, operand2);
3359 if (x != Py_NotImplemented) {
3361 goto exit_binary_result_object;
3364 Py_DECREF_IMMORTAL(x);
3374 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: 'long' and 'int'");
3375 goto exit_binary_exception;
3377exit_binary_result_object:
3378 if (unlikely(obj_result == NULL)) {
3379 return NUITKA_BOOL_EXCEPTION;
3383 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3384 Py_DECREF(obj_result);
3388exit_binary_exception:
3389 return NUITKA_BOOL_EXCEPTION;
3392nuitka_bool BINARY_OPERATION_MULT_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2) {
3393 return _BINARY_OPERATION_MULT_NBOOL_LONG_INT(operand1, operand2);
3397#if PYTHON_VERSION < 0x300
3399static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
3400 CHECK_OBJECT(operand1);
3401 assert(PyInt_CheckExact(operand1));
3406#if defined(_MSC_VER)
3407#pragma warning(push)
3408#pragma warning(disable : 4101)
3410 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3411 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3412 NUITKA_MAY_BE_UNUSED
long clong_result;
3413 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3414#if defined(_MSC_VER)
3418 CHECK_OBJECT(operand1);
3419 assert(PyInt_CheckExact(operand1));
3421 const long a = PyInt_AS_LONG(operand1);
3422 const long b = operand2;
3424 const long longprod = (long)((
unsigned long)a * b);
3425 const double doubleprod = (double)a * (
double)b;
3426 const double doubled_longprod = (double)longprod;
3428 if (likely(doubled_longprod == doubleprod)) {
3429 clong_result = longprod;
3430 goto exit_result_ok_clong;
3432 const double diff = doubled_longprod - doubleprod;
3433 const double absdiff = diff >= 0.0 ? diff : -diff;
3434 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
3436 if (likely(32.0 * absdiff <= absprod)) {
3437 clong_result = longprod;
3438 goto exit_result_ok_clong;
3443 PyObject *operand1_object = operand1;
3444 PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
3446 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
3447 assert(r != Py_NotImplemented);
3449 Py_DECREF(operand2_object);
3452 goto exit_result_object;
3455exit_result_ok_clong:
3456 result = Nuitka_PyInt_FromLong(clong_result);
3457 goto exit_result_ok;
3460 if (unlikely(obj_result == NULL)) {
3461 goto exit_result_exception;
3463 result = obj_result;
3464 goto exit_result_ok;
3469exit_result_exception:
3473PyObject *BINARY_OPERATION_MULT_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
3474 return _BINARY_OPERATION_MULT_OBJECT_INT_CLONG(operand1, operand2);
3478#if PYTHON_VERSION < 0x300
3480static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_INT_CLONG(PyObject *operand1,
long operand2) {
3481 CHECK_OBJECT(operand1);
3482 assert(PyInt_CheckExact(operand1));
3487#if defined(_MSC_VER)
3488#pragma warning(push)
3489#pragma warning(disable : 4101)
3491 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3492 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3493 NUITKA_MAY_BE_UNUSED
long clong_result;
3494 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3495#if defined(_MSC_VER)
3499 CHECK_OBJECT(operand1);
3500 assert(PyInt_CheckExact(operand1));
3502 const long a = PyInt_AS_LONG(operand1);
3503 const long b = operand2;
3505 const long longprod = (long)((
unsigned long)a * b);
3506 const double doubleprod = (double)a * (
double)b;
3507 const double doubled_longprod = (double)longprod;
3509 if (likely(doubled_longprod == doubleprod)) {
3510 clong_result = longprod;
3511 goto exit_result_ok_clong;
3513 const double diff = doubled_longprod - doubleprod;
3514 const double absdiff = diff >= 0.0 ? diff : -diff;
3515 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
3517 if (likely(32.0 * absdiff <= absprod)) {
3518 clong_result = longprod;
3519 goto exit_result_ok_clong;
3524 PyObject *operand1_object = operand1;
3525 PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
3527 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
3528 assert(r != Py_NotImplemented);
3530 Py_DECREF(operand2_object);
3533 goto exit_result_object;
3536exit_result_ok_clong:
3537 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3538 goto exit_result_ok;
3541 if (unlikely(obj_result == NULL)) {
3542 goto exit_result_exception;
3544 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3545 Py_DECREF(obj_result);
3546 goto exit_result_ok;
3551exit_result_exception:
3552 return NUITKA_BOOL_EXCEPTION;
3555nuitka_bool BINARY_OPERATION_MULT_NBOOL_INT_CLONG(PyObject *operand1,
long operand2) {
3556 return _BINARY_OPERATION_MULT_NBOOL_INT_CLONG(operand1, operand2);
3561static PyObject *_BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
3562 CHECK_OBJECT(operand1);
3563 assert(PyFloat_CheckExact(operand1));
3567#if defined(_MSC_VER)
3568#pragma warning(push)
3569#pragma warning(disable : 4101)
3572 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3573 NUITKA_MAY_BE_UNUSED
long clong_result;
3574 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3575#if defined(_MSC_VER)
3579 CHECK_OBJECT(operand1);
3580 assert(PyFloat_CheckExact(operand1));
3582 const double a = PyFloat_AS_DOUBLE(operand1);
3583 const double b = operand2;
3588 goto exit_result_ok_cfloat;
3590exit_result_ok_cfloat:
3591 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
3592 goto exit_result_ok;
3598PyObject *BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
3599 return _BINARY_OPERATION_MULT_OBJECT_FLOAT_CFLOAT(operand1, operand2);
3603static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
3604 CHECK_OBJECT(operand1);
3605 assert(PyFloat_CheckExact(operand1));
3609#if defined(_MSC_VER)
3610#pragma warning(push)
3611#pragma warning(disable : 4101)
3614 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3615 NUITKA_MAY_BE_UNUSED
long clong_result;
3616 NUITKA_MAY_BE_UNUSED
double cfloat_result;
3617#if defined(_MSC_VER)
3621 CHECK_OBJECT(operand1);
3622 assert(PyFloat_CheckExact(operand1));
3624 const double a = PyFloat_AS_DOUBLE(operand1);
3625 const double b = operand2;
3630 goto exit_result_ok_cfloat;
3632exit_result_ok_cfloat:
3633 result = cfloat_result != 0.0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
3634 goto exit_result_ok;
3640nuitka_bool BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
3641 return _BINARY_OPERATION_MULT_NBOOL_FLOAT_CFLOAT(operand1, operand2);
3644#if PYTHON_VERSION < 0x300
3646static PyObject *_BINARY_OPERATION_MULT_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {
3647 CHECK_OBJECT(operand1);
3648 assert(PyString_CheckExact(operand1));
3649 CHECK_OBJECT(operand2);
3650 assert(PyInt_CheckExact(operand2));
3652#if defined(_MSC_VER)
3653#pragma warning(push)
3654#pragma warning(disable : 4101)
3656 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3657 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3658#if defined(_MSC_VER)
3667 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
3669 goto exit_binary_exception;
3673 PyObject *index_value = operand2;
3676 Py_ssize_t count = PyInt_AS_LONG(index_value);
3678 ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;
3679 PyObject *r = (*repeatfunc)(operand1, count);
3682 goto exit_binary_result_object;
3687 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
3689exit_binary_result_object:
3692exit_binary_exception:
3696PyObject *BINARY_OPERATION_MULT_OBJECT_STR_INT(PyObject *operand1, PyObject *operand2) {
3697 return _BINARY_OPERATION_MULT_OBJECT_STR_INT(operand1, operand2);
3701#if PYTHON_VERSION < 0x300
3703static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_STR(PyObject *operand1, PyObject *operand2) {
3704 CHECK_OBJECT(operand1);
3705 assert(PyInt_CheckExact(operand1));
3706 CHECK_OBJECT(operand2);
3707 assert(PyString_CheckExact(operand2));
3709#if defined(_MSC_VER)
3710#pragma warning(push)
3711#pragma warning(disable : 4101)
3713 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3714 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3715#if defined(_MSC_VER)
3727 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
3729 goto exit_binary_exception;
3733 PyObject *index_value = operand1;
3736 Py_ssize_t count = PyInt_AS_LONG(index_value);
3738 ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;
3739 PyObject *r = (*repeatfunc)(operand2, count);
3742 goto exit_binary_result_object;
3747 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
3749exit_binary_result_object:
3752exit_binary_exception:
3756PyObject *BINARY_OPERATION_MULT_OBJECT_INT_STR(PyObject *operand1, PyObject *operand2) {
3757 return _BINARY_OPERATION_MULT_OBJECT_INT_STR(operand1, operand2);
3761#if PYTHON_VERSION < 0x300
3763static PyObject *_BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {
3764 CHECK_OBJECT(operand1);
3765 assert(PyUnicode_CheckExact(operand1));
3766 CHECK_OBJECT(operand2);
3767 assert(PyInt_CheckExact(operand2));
3769#if defined(_MSC_VER)
3770#pragma warning(push)
3771#pragma warning(disable : 4101)
3773 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3774 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3775#if defined(_MSC_VER)
3784 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
3786 goto exit_binary_exception;
3790 PyObject *index_value = operand2;
3793 Py_ssize_t count = PyInt_AS_LONG(index_value);
3795 ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;
3796 PyObject *r = (*repeatfunc)(operand1, count);
3799 goto exit_binary_result_object;
3804 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
3806exit_binary_result_object:
3809exit_binary_exception:
3813PyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(PyObject *operand1, PyObject *operand2) {
3814 return _BINARY_OPERATION_MULT_OBJECT_UNICODE_INT(operand1, operand2);
3818#if PYTHON_VERSION < 0x300
3820static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(PyObject *operand1, PyObject *operand2) {
3821 CHECK_OBJECT(operand1);
3822 assert(PyInt_CheckExact(operand1));
3823 CHECK_OBJECT(operand2);
3824 assert(PyUnicode_CheckExact(operand2));
3826#if defined(_MSC_VER)
3827#pragma warning(push)
3828#pragma warning(disable : 4101)
3830 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3831 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3832#if defined(_MSC_VER)
3844 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
3846 goto exit_binary_exception;
3850 PyObject *index_value = operand1;
3853 Py_ssize_t count = PyInt_AS_LONG(index_value);
3855 ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;
3856 PyObject *r = (*repeatfunc)(operand2, count);
3859 goto exit_binary_result_object;
3864 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
3866exit_binary_result_object:
3869exit_binary_exception:
3873PyObject *BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(PyObject *operand1, PyObject *operand2) {
3874 return _BINARY_OPERATION_MULT_OBJECT_INT_UNICODE(operand1, operand2);
3878#if PYTHON_VERSION < 0x300
3880static PyObject *_BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(PyObject *operand1, PyObject *operand2) {
3881 CHECK_OBJECT(operand1);
3882 assert(PyTuple_CheckExact(operand1));
3883 CHECK_OBJECT(operand2);
3884 assert(PyInt_CheckExact(operand2));
3886#if defined(_MSC_VER)
3887#pragma warning(push)
3888#pragma warning(disable : 4101)
3890 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3891 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3892#if defined(_MSC_VER)
3901 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
3903 goto exit_binary_exception;
3907 PyObject *index_value = operand2;
3910 Py_ssize_t count = PyInt_AS_LONG(index_value);
3912 ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;
3913 PyObject *r = (*repeatfunc)(operand1, count);
3916 goto exit_binary_result_object;
3921 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
3923exit_binary_result_object:
3926exit_binary_exception:
3930PyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(PyObject *operand1, PyObject *operand2) {
3931 return _BINARY_OPERATION_MULT_OBJECT_TUPLE_INT(operand1, operand2);
3935#if PYTHON_VERSION < 0x300
3937static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(PyObject *operand1, PyObject *operand2) {
3938 CHECK_OBJECT(operand1);
3939 assert(PyInt_CheckExact(operand1));
3940 CHECK_OBJECT(operand2);
3941 assert(PyTuple_CheckExact(operand2));
3943#if defined(_MSC_VER)
3944#pragma warning(push)
3945#pragma warning(disable : 4101)
3947 NUITKA_MAY_BE_UNUSED
bool cbool_result;
3948 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
3949#if defined(_MSC_VER)
3961 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
3963 goto exit_binary_exception;
3967 PyObject *index_value = operand1;
3970 Py_ssize_t count = PyInt_AS_LONG(index_value);
3972 ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;
3973 PyObject *r = (*repeatfunc)(operand2, count);
3976 goto exit_binary_result_object;
3981 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
3983exit_binary_result_object:
3986exit_binary_exception:
3990PyObject *BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(PyObject *operand1, PyObject *operand2) {
3991 return _BINARY_OPERATION_MULT_OBJECT_INT_TUPLE(operand1, operand2);
3995#if PYTHON_VERSION < 0x300
3997static PyObject *_BINARY_OPERATION_MULT_OBJECT_LIST_INT(PyObject *operand1, PyObject *operand2) {
3998 CHECK_OBJECT(operand1);
3999 assert(PyList_CheckExact(operand1));
4000 CHECK_OBJECT(operand2);
4001 assert(PyInt_CheckExact(operand2));
4003#if defined(_MSC_VER)
4004#pragma warning(push)
4005#pragma warning(disable : 4101)
4007 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4008 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4009#if defined(_MSC_VER)
4018 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
4020 goto exit_binary_exception;
4024 PyObject *index_value = operand2;
4027 Py_ssize_t count = PyInt_AS_LONG(index_value);
4029 ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;
4030 PyObject *r = (*repeatfunc)(operand1, count);
4033 goto exit_binary_result_object;
4038 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4040exit_binary_result_object:
4043exit_binary_exception:
4047PyObject *BINARY_OPERATION_MULT_OBJECT_LIST_INT(PyObject *operand1, PyObject *operand2) {
4048 return _BINARY_OPERATION_MULT_OBJECT_LIST_INT(operand1, operand2);
4052#if PYTHON_VERSION < 0x300
4054static PyObject *_BINARY_OPERATION_MULT_OBJECT_INT_LIST(PyObject *operand1, PyObject *operand2) {
4055 CHECK_OBJECT(operand1);
4056 assert(PyInt_CheckExact(operand1));
4057 CHECK_OBJECT(operand2);
4058 assert(PyList_CheckExact(operand2));
4060#if defined(_MSC_VER)
4061#pragma warning(push)
4062#pragma warning(disable : 4101)
4064 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4065 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4066#if defined(_MSC_VER)
4078 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4080 goto exit_binary_exception;
4084 PyObject *index_value = operand1;
4087 Py_ssize_t count = PyInt_AS_LONG(index_value);
4089 ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;
4090 PyObject *r = (*repeatfunc)(operand2, count);
4093 goto exit_binary_result_object;
4098 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4100exit_binary_result_object:
4103exit_binary_exception:
4107PyObject *BINARY_OPERATION_MULT_OBJECT_INT_LIST(PyObject *operand1, PyObject *operand2) {
4108 return _BINARY_OPERATION_MULT_OBJECT_INT_LIST(operand1, operand2);
4114static PyObject *_BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {
4115 CHECK_OBJECT(operand1);
4116 assert(PyUnicode_CheckExact(operand1));
4117 CHECK_OBJECT(operand2);
4118 assert(PyLong_CheckExact(operand2));
4120#if defined(_MSC_VER)
4121#pragma warning(push)
4122#pragma warning(disable : 4101)
4124 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4125 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4126#if defined(_MSC_VER)
4135 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
4137 goto exit_binary_exception;
4141 PyObject *index_value = operand2;
4144 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4147 if (unlikely(count == -1)) {
4148#if PYTHON_VERSION < 0x300
4149 PyErr_Format(PyExc_OverflowError,
"cannot fit 'long' into an index-sized integer");
4151 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4153 goto exit_binary_exception;
4156 ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;
4157 PyObject *r = (*repeatfunc)(operand1, count);
4160 goto exit_binary_result_object;
4165 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4167exit_binary_result_object:
4170exit_binary_exception:
4174PyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(PyObject *operand1, PyObject *operand2) {
4175 return _BINARY_OPERATION_MULT_OBJECT_UNICODE_LONG(operand1, operand2);
4180static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(PyObject *operand1, PyObject *operand2) {
4181 CHECK_OBJECT(operand1);
4182 assert(PyLong_CheckExact(operand1));
4183 CHECK_OBJECT(operand2);
4184 assert(PyUnicode_CheckExact(operand2));
4186#if defined(_MSC_VER)
4187#pragma warning(push)
4188#pragma warning(disable : 4101)
4190 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4191 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4192#if defined(_MSC_VER)
4204 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4206 goto exit_binary_exception;
4210 PyObject *index_value = operand1;
4213 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4216 if (unlikely(count == -1)) {
4217#if PYTHON_VERSION < 0x300
4218 PyErr_Format(PyExc_OverflowError,
"cannot fit 'long' into an index-sized integer");
4220 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4222 goto exit_binary_exception;
4225 ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;
4226 PyObject *r = (*repeatfunc)(operand2, count);
4229 goto exit_binary_result_object;
4234 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4236exit_binary_result_object:
4239exit_binary_exception:
4243PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(PyObject *operand1, PyObject *operand2) {
4244 return _BINARY_OPERATION_MULT_OBJECT_LONG_UNICODE(operand1, operand2);
4247#if PYTHON_VERSION >= 0x300
4249static PyObject *_BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {
4250 CHECK_OBJECT(operand1);
4251 assert(PyBytes_CheckExact(operand1));
4252 CHECK_OBJECT(operand2);
4253 assert(PyLong_CheckExact(operand2));
4255#if defined(_MSC_VER)
4256#pragma warning(push)
4257#pragma warning(disable : 4101)
4259 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4260 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4261#if defined(_MSC_VER)
4270 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
4272 goto exit_binary_exception;
4276 PyObject *index_value = operand2;
4279 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4282 if (unlikely(count == -1)) {
4283 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4284 goto exit_binary_exception;
4287 ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;
4288 PyObject *r = (*repeatfunc)(operand1, count);
4291 goto exit_binary_result_object;
4296 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4298exit_binary_result_object:
4301exit_binary_exception:
4305PyObject *BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(PyObject *operand1, PyObject *operand2) {
4306 return _BINARY_OPERATION_MULT_OBJECT_BYTES_LONG(operand1, operand2);
4310#if PYTHON_VERSION >= 0x300
4312static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(PyObject *operand1, PyObject *operand2) {
4313 CHECK_OBJECT(operand1);
4314 assert(PyLong_CheckExact(operand1));
4315 CHECK_OBJECT(operand2);
4316 assert(PyBytes_CheckExact(operand2));
4318#if defined(_MSC_VER)
4319#pragma warning(push)
4320#pragma warning(disable : 4101)
4322 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4323 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4324#if defined(_MSC_VER)
4336 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4338 goto exit_binary_exception;
4342 PyObject *index_value = operand1;
4345 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4348 if (unlikely(count == -1)) {
4349 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4350 goto exit_binary_exception;
4353 ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;
4354 PyObject *r = (*repeatfunc)(operand2, count);
4357 goto exit_binary_result_object;
4362 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4364exit_binary_result_object:
4367exit_binary_exception:
4371PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(PyObject *operand1, PyObject *operand2) {
4372 return _BINARY_OPERATION_MULT_OBJECT_LONG_BYTES(operand1, operand2);
4377static PyObject *_BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(PyObject *operand1, PyObject *operand2) {
4378 CHECK_OBJECT(operand1);
4379 assert(PyTuple_CheckExact(operand1));
4380 CHECK_OBJECT(operand2);
4381 assert(PyLong_CheckExact(operand2));
4383#if defined(_MSC_VER)
4384#pragma warning(push)
4385#pragma warning(disable : 4101)
4387 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4388 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4389#if defined(_MSC_VER)
4398 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
4400 goto exit_binary_exception;
4404 PyObject *index_value = operand2;
4407 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4410 if (unlikely(count == -1)) {
4411#if PYTHON_VERSION < 0x300
4412 PyErr_Format(PyExc_OverflowError,
"cannot fit 'long' into an index-sized integer");
4414 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4416 goto exit_binary_exception;
4419 ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;
4420 PyObject *r = (*repeatfunc)(operand1, count);
4423 goto exit_binary_result_object;
4428 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4430exit_binary_result_object:
4433exit_binary_exception:
4437PyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(PyObject *operand1, PyObject *operand2) {
4438 return _BINARY_OPERATION_MULT_OBJECT_TUPLE_LONG(operand1, operand2);
4442static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(PyObject *operand1, PyObject *operand2) {
4443 CHECK_OBJECT(operand1);
4444 assert(PyLong_CheckExact(operand1));
4445 CHECK_OBJECT(operand2);
4446 assert(PyTuple_CheckExact(operand2));
4448#if defined(_MSC_VER)
4449#pragma warning(push)
4450#pragma warning(disable : 4101)
4452 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4453 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4454#if defined(_MSC_VER)
4466 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4468 goto exit_binary_exception;
4472 PyObject *index_value = operand1;
4475 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4478 if (unlikely(count == -1)) {
4479#if PYTHON_VERSION < 0x300
4480 PyErr_Format(PyExc_OverflowError,
"cannot fit 'long' into an index-sized integer");
4482 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4484 goto exit_binary_exception;
4487 ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;
4488 PyObject *r = (*repeatfunc)(operand2, count);
4491 goto exit_binary_result_object;
4496 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4498exit_binary_result_object:
4501exit_binary_exception:
4505PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(PyObject *operand1, PyObject *operand2) {
4506 return _BINARY_OPERATION_MULT_OBJECT_LONG_TUPLE(operand1, operand2);
4510static PyObject *_BINARY_OPERATION_MULT_OBJECT_LIST_LONG(PyObject *operand1, PyObject *operand2) {
4511 CHECK_OBJECT(operand1);
4512 assert(PyList_CheckExact(operand1));
4513 CHECK_OBJECT(operand2);
4514 assert(PyLong_CheckExact(operand2));
4516#if defined(_MSC_VER)
4517#pragma warning(push)
4518#pragma warning(disable : 4101)
4520 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4521 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4522#if defined(_MSC_VER)
4531 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
4533 goto exit_binary_exception;
4537 PyObject *index_value = operand2;
4540 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4543 if (unlikely(count == -1)) {
4544#if PYTHON_VERSION < 0x300
4545 PyErr_Format(PyExc_OverflowError,
"cannot fit 'long' into an index-sized integer");
4547 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4549 goto exit_binary_exception;
4552 ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;
4553 PyObject *r = (*repeatfunc)(operand1, count);
4556 goto exit_binary_result_object;
4561 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4563exit_binary_result_object:
4566exit_binary_exception:
4570PyObject *BINARY_OPERATION_MULT_OBJECT_LIST_LONG(PyObject *operand1, PyObject *operand2) {
4571 return _BINARY_OPERATION_MULT_OBJECT_LIST_LONG(operand1, operand2);
4575static PyObject *_BINARY_OPERATION_MULT_OBJECT_LONG_LIST(PyObject *operand1, PyObject *operand2) {
4576 CHECK_OBJECT(operand1);
4577 assert(PyLong_CheckExact(operand1));
4578 CHECK_OBJECT(operand2);
4579 assert(PyList_CheckExact(operand2));
4581#if defined(_MSC_VER)
4582#pragma warning(push)
4583#pragma warning(disable : 4101)
4585 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4586 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4587#if defined(_MSC_VER)
4599 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4601 goto exit_binary_exception;
4605 PyObject *index_value = operand1;
4608 Py_ssize_t count = CONVERT_LONG_TO_REPEAT_FACTOR(index_value);
4611 if (unlikely(count == -1)) {
4612#if PYTHON_VERSION < 0x300
4613 PyErr_Format(PyExc_OverflowError,
"cannot fit 'long' into an index-sized integer");
4615 PyErr_Format(PyExc_OverflowError,
"cannot fit 'int' into an index-sized integer");
4617 goto exit_binary_exception;
4620 ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;
4621 PyObject *r = (*repeatfunc)(operand2, count);
4624 goto exit_binary_result_object;
4629 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4631exit_binary_result_object:
4634exit_binary_exception:
4638PyObject *BINARY_OPERATION_MULT_OBJECT_LONG_LIST(PyObject *operand1, PyObject *operand2) {
4639 return _BINARY_OPERATION_MULT_OBJECT_LONG_LIST(operand1, operand2);
4642#if PYTHON_VERSION < 0x300
4644static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {
4645 CHECK_OBJECT(operand1);
4646 CHECK_OBJECT(operand2);
4647 assert(PyString_CheckExact(operand2));
4649 PyTypeObject *type1 = Py_TYPE(operand1);
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)
4662 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
4664 if (slot1 != NULL) {
4665 PyObject *x = slot1(operand1, operand2);
4667 if (x != Py_NotImplemented) {
4669 goto exit_binary_result_object;
4672 Py_DECREF_IMMORTAL(x);
4675#if PYTHON_VERSION < 0x300
4676 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
4678 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
4681 PyObject *coerced1 = operand1;
4682 PyObject *coerced2 = operand2;
4684 int err = c1(&coerced1, &coerced2);
4686 if (unlikely(err < 0)) {
4687 goto exit_binary_exception;
4691 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
4693 if (likely(mv == NULL)) {
4694 binaryfunc slot = mv->nb_multiply;
4696 if (likely(slot != NULL)) {
4697 PyObject *x = slot(coerced1, coerced2);
4699 Py_DECREF(coerced1);
4700 Py_DECREF(coerced2);
4703 goto exit_binary_result_object;
4708 Py_DECREF(coerced1);
4709 Py_DECREF(coerced2);
4717 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
4719 if (sq_slot != NULL) {
4720 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
4722 obj_result = result;
4723 goto exit_binary_result_object;
4726 if (unlikely(!Nuitka_Index_Check(operand1))) {
4727 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4729 goto exit_binary_exception;
4733 PyObject *index_value = Nuitka_Number_Index(operand1);
4735 if (unlikely(index_value == NULL)) {
4736 goto exit_binary_exception;
4740 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
4742 Py_DECREF(index_value);
4745 if (unlikely(count == -1)) {
4746 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type1->tp_name);
4747 goto exit_binary_exception;
4750 ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;
4751 PyObject *r = (*repeatfunc)(operand2, count);
4754 goto exit_binary_result_object;
4759 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4761exit_binary_result_object:
4764exit_binary_exception:
4768PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2) {
4769 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_STR(operand1, operand2);
4773#if PYTHON_VERSION < 0x300
4775static PyObject *_BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {
4776 CHECK_OBJECT(operand1);
4777 assert(PyString_CheckExact(operand1));
4778 CHECK_OBJECT(operand2);
4780 PyTypeObject *type2 = Py_TYPE(operand2);
4782#if defined(_MSC_VER)
4783#pragma warning(push)
4784#pragma warning(disable : 4101)
4786 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4787 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4788#if defined(_MSC_VER)
4792 binaryfunc slot2 = NULL;
4794 if (!(&PyString_Type == type2)) {
4797 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
4800 if (slot2 != NULL) {
4801 PyObject *x = slot2(operand1, operand2);
4803 if (x != Py_NotImplemented) {
4805 goto exit_binary_result_object;
4808 Py_DECREF_IMMORTAL(x);
4811#if PYTHON_VERSION < 0x300
4812 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
4814 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
4817 PyObject *coerced1 = operand1;
4818 PyObject *coerced2 = operand2;
4820 int err = c2(&coerced2, &coerced1);
4822 if (unlikely(err < 0)) {
4823 goto exit_binary_exception;
4827 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
4829 if (likely(mv == NULL)) {
4830 binaryfunc slot = mv->nb_multiply;
4832 if (likely(slot != NULL)) {
4833 PyObject *x = slot(coerced1, coerced2);
4835 Py_DECREF(coerced1);
4836 Py_DECREF(coerced2);
4839 goto exit_binary_result_object;
4844 Py_DECREF(coerced1);
4845 Py_DECREF(coerced2);
4851 if (unlikely(!Nuitka_Index_Check(operand2))) {
4852 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
4854 goto exit_binary_exception;
4858 PyObject *index_value = Nuitka_Number_Index(operand2);
4860 if (unlikely(index_value == NULL)) {
4861 goto exit_binary_exception;
4865 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
4867 Py_DECREF(index_value);
4870 if (unlikely(count == -1)) {
4871 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type2->tp_name);
4872 goto exit_binary_exception;
4875 ssizeargfunc repeatfunc = PyString_Type.tp_as_sequence->sq_repeat;
4876 PyObject *r = (*repeatfunc)(operand1, count);
4879 goto exit_binary_result_object;
4884 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
4886exit_binary_result_object:
4889exit_binary_exception:
4893PyObject *BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2) {
4894 return _BINARY_OPERATION_MULT_OBJECT_STR_OBJECT(operand1, operand2);
4899static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {
4900 CHECK_OBJECT(operand1);
4901 CHECK_OBJECT(operand2);
4902 assert(PyUnicode_CheckExact(operand2));
4904 PyTypeObject *type1 = Py_TYPE(operand1);
4906#if defined(_MSC_VER)
4907#pragma warning(push)
4908#pragma warning(disable : 4101)
4910 NUITKA_MAY_BE_UNUSED
bool cbool_result;
4911 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
4912#if defined(_MSC_VER)
4917 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
4919 if (slot1 != NULL) {
4920 PyObject *x = slot1(operand1, operand2);
4922 if (x != Py_NotImplemented) {
4924 goto exit_binary_result_object;
4927 Py_DECREF_IMMORTAL(x);
4930#if PYTHON_VERSION < 0x300
4931 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
4933 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
4936 PyObject *coerced1 = operand1;
4937 PyObject *coerced2 = operand2;
4939 int err = c1(&coerced1, &coerced2);
4941 if (unlikely(err < 0)) {
4942 goto exit_binary_exception;
4946 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
4948 if (likely(mv == NULL)) {
4949 binaryfunc slot = mv->nb_multiply;
4951 if (likely(slot != NULL)) {
4952 PyObject *x = slot(coerced1, coerced2);
4954 Py_DECREF(coerced1);
4955 Py_DECREF(coerced2);
4958 goto exit_binary_result_object;
4963 Py_DECREF(coerced1);
4964 Py_DECREF(coerced2);
4972 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
4974 if (sq_slot != NULL) {
4975 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
4977 obj_result = result;
4978 goto exit_binary_result_object;
4981 if (unlikely(!Nuitka_Index_Check(operand1))) {
4982 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
4984 goto exit_binary_exception;
4988 PyObject *index_value = Nuitka_Number_Index(operand1);
4990 if (unlikely(index_value == NULL)) {
4991 goto exit_binary_exception;
4995 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
4997 Py_DECREF(index_value);
5000 if (unlikely(count == -1)) {
5001 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type1->tp_name);
5002 goto exit_binary_exception;
5005 ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;
5006 PyObject *r = (*repeatfunc)(operand2, count);
5009 goto exit_binary_result_object;
5014 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5016exit_binary_result_object:
5019exit_binary_exception:
5023PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2) {
5024 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_UNICODE(operand1, operand2);
5028static PyObject *_BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {
5029 CHECK_OBJECT(operand1);
5030 assert(PyUnicode_CheckExact(operand1));
5031 CHECK_OBJECT(operand2);
5033 PyTypeObject *type2 = Py_TYPE(operand2);
5035#if defined(_MSC_VER)
5036#pragma warning(push)
5037#pragma warning(disable : 4101)
5039 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5040 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5041#if defined(_MSC_VER)
5045 binaryfunc slot2 = NULL;
5047 if (!(&PyUnicode_Type == type2)) {
5050 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
5053 if (slot2 != NULL) {
5054 PyObject *x = slot2(operand1, operand2);
5056 if (x != Py_NotImplemented) {
5058 goto exit_binary_result_object;
5061 Py_DECREF_IMMORTAL(x);
5064#if PYTHON_VERSION < 0x300
5065 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
5067 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
5070 PyObject *coerced1 = operand1;
5071 PyObject *coerced2 = operand2;
5073 int err = c2(&coerced2, &coerced1);
5075 if (unlikely(err < 0)) {
5076 goto exit_binary_exception;
5080 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5082 if (likely(mv == NULL)) {
5083 binaryfunc slot = mv->nb_multiply;
5085 if (likely(slot != NULL)) {
5086 PyObject *x = slot(coerced1, coerced2);
5088 Py_DECREF(coerced1);
5089 Py_DECREF(coerced2);
5092 goto exit_binary_result_object;
5097 Py_DECREF(coerced1);
5098 Py_DECREF(coerced2);
5104 if (unlikely(!Nuitka_Index_Check(operand2))) {
5105 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
5107 goto exit_binary_exception;
5111 PyObject *index_value = Nuitka_Number_Index(operand2);
5113 if (unlikely(index_value == NULL)) {
5114 goto exit_binary_exception;
5118 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5120 Py_DECREF(index_value);
5123 if (unlikely(count == -1)) {
5124 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type2->tp_name);
5125 goto exit_binary_exception;
5128 ssizeargfunc repeatfunc = PyUnicode_Type.tp_as_sequence->sq_repeat;
5129 PyObject *r = (*repeatfunc)(operand1, count);
5132 goto exit_binary_result_object;
5137 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5139exit_binary_result_object:
5142exit_binary_exception:
5146PyObject *BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2) {
5147 return _BINARY_OPERATION_MULT_OBJECT_UNICODE_OBJECT(operand1, operand2);
5150#if PYTHON_VERSION >= 0x300
5152static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {
5153 CHECK_OBJECT(operand1);
5154 CHECK_OBJECT(operand2);
5155 assert(PyBytes_CheckExact(operand2));
5157 PyTypeObject *type1 = Py_TYPE(operand1);
5159#if defined(_MSC_VER)
5160#pragma warning(push)
5161#pragma warning(disable : 4101)
5163 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5164 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5165#if defined(_MSC_VER)
5170 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
5172 if (slot1 != NULL) {
5173 PyObject *x = slot1(operand1, operand2);
5175 if (x != Py_NotImplemented) {
5177 goto exit_binary_result_object;
5180 Py_DECREF_IMMORTAL(x);
5183#if PYTHON_VERSION < 0x300
5184 if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {
5186 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
5189 PyObject *coerced1 = operand1;
5190 PyObject *coerced2 = operand2;
5192 int err = c1(&coerced1, &coerced2);
5194 if (unlikely(err < 0)) {
5195 goto exit_binary_exception;
5199 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5201 if (likely(mv == NULL)) {
5202 binaryfunc slot = mv->nb_multiply;
5204 if (likely(slot != NULL)) {
5205 PyObject *x = slot(coerced1, coerced2);
5207 Py_DECREF(coerced1);
5208 Py_DECREF(coerced2);
5211 goto exit_binary_result_object;
5216 Py_DECREF(coerced1);
5217 Py_DECREF(coerced2);
5225 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
5227 if (sq_slot != NULL) {
5228 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
5230 obj_result = result;
5231 goto exit_binary_result_object;
5234 if (unlikely(!Nuitka_Index_Check(operand1))) {
5235 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
5237 goto exit_binary_exception;
5241 PyObject *index_value = Nuitka_Number_Index(operand1);
5243 if (unlikely(index_value == NULL)) {
5244 goto exit_binary_exception;
5248 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5250 Py_DECREF(index_value);
5253 if (unlikely(count == -1)) {
5254 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type1->tp_name);
5255 goto exit_binary_exception;
5258 ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;
5259 PyObject *r = (*repeatfunc)(operand2, count);
5262 goto exit_binary_result_object;
5267 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5269exit_binary_result_object:
5272exit_binary_exception:
5276PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2) {
5277 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_BYTES(operand1, operand2);
5281#if PYTHON_VERSION >= 0x300
5283static PyObject *_BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {
5284 CHECK_OBJECT(operand1);
5285 assert(PyBytes_CheckExact(operand1));
5286 CHECK_OBJECT(operand2);
5288 PyTypeObject *type2 = Py_TYPE(operand2);
5290#if defined(_MSC_VER)
5291#pragma warning(push)
5292#pragma warning(disable : 4101)
5294 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5295 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5296#if defined(_MSC_VER)
5300 binaryfunc slot2 = NULL;
5302 if (!(&PyBytes_Type == type2)) {
5305 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
5308 if (slot2 != NULL) {
5309 PyObject *x = slot2(operand1, operand2);
5311 if (x != Py_NotImplemented) {
5313 goto exit_binary_result_object;
5316 Py_DECREF_IMMORTAL(x);
5319#if PYTHON_VERSION < 0x300
5320 if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
5322 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
5325 PyObject *coerced1 = operand1;
5326 PyObject *coerced2 = operand2;
5328 int err = c2(&coerced2, &coerced1);
5330 if (unlikely(err < 0)) {
5331 goto exit_binary_exception;
5335 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5337 if (likely(mv == NULL)) {
5338 binaryfunc slot = mv->nb_multiply;
5340 if (likely(slot != NULL)) {
5341 PyObject *x = slot(coerced1, coerced2);
5343 Py_DECREF(coerced1);
5344 Py_DECREF(coerced2);
5347 goto exit_binary_result_object;
5352 Py_DECREF(coerced1);
5353 Py_DECREF(coerced2);
5359 if (unlikely(!Nuitka_Index_Check(operand2))) {
5360 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
5362 goto exit_binary_exception;
5366 PyObject *index_value = Nuitka_Number_Index(operand2);
5368 if (unlikely(index_value == NULL)) {
5369 goto exit_binary_exception;
5373 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5375 Py_DECREF(index_value);
5378 if (unlikely(count == -1)) {
5379 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type2->tp_name);
5380 goto exit_binary_exception;
5383 ssizeargfunc repeatfunc = PyBytes_Type.tp_as_sequence->sq_repeat;
5384 PyObject *r = (*repeatfunc)(operand1, count);
5387 goto exit_binary_result_object;
5392 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5394exit_binary_result_object:
5397exit_binary_exception:
5401PyObject *BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2) {
5402 return _BINARY_OPERATION_MULT_OBJECT_BYTES_OBJECT(operand1, operand2);
5407static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {
5408 CHECK_OBJECT(operand1);
5409 CHECK_OBJECT(operand2);
5410 assert(PyTuple_CheckExact(operand2));
5412 PyTypeObject *type1 = Py_TYPE(operand1);
5414#if defined(_MSC_VER)
5415#pragma warning(push)
5416#pragma warning(disable : 4101)
5418 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5419 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5420#if defined(_MSC_VER)
5425 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
5427 if (slot1 != NULL) {
5428 PyObject *x = slot1(operand1, operand2);
5430 if (x != Py_NotImplemented) {
5432 goto exit_binary_result_object;
5435 Py_DECREF_IMMORTAL(x);
5438#if PYTHON_VERSION < 0x300
5439 if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {
5441 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
5444 PyObject *coerced1 = operand1;
5445 PyObject *coerced2 = operand2;
5447 int err = c1(&coerced1, &coerced2);
5449 if (unlikely(err < 0)) {
5450 goto exit_binary_exception;
5454 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5456 if (likely(mv == NULL)) {
5457 binaryfunc slot = mv->nb_multiply;
5459 if (likely(slot != NULL)) {
5460 PyObject *x = slot(coerced1, coerced2);
5462 Py_DECREF(coerced1);
5463 Py_DECREF(coerced2);
5466 goto exit_binary_result_object;
5471 Py_DECREF(coerced1);
5472 Py_DECREF(coerced2);
5480 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
5482 if (sq_slot != NULL) {
5483 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
5485 obj_result = result;
5486 goto exit_binary_result_object;
5489 if (unlikely(!Nuitka_Index_Check(operand1))) {
5490 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
5492 goto exit_binary_exception;
5496 PyObject *index_value = Nuitka_Number_Index(operand1);
5498 if (unlikely(index_value == NULL)) {
5499 goto exit_binary_exception;
5503 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5505 Py_DECREF(index_value);
5508 if (unlikely(count == -1)) {
5509 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type1->tp_name);
5510 goto exit_binary_exception;
5513 ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;
5514 PyObject *r = (*repeatfunc)(operand2, count);
5517 goto exit_binary_result_object;
5522 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5524exit_binary_result_object:
5527exit_binary_exception:
5531PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2) {
5532 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_TUPLE(operand1, operand2);
5536static PyObject *_BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {
5537 CHECK_OBJECT(operand1);
5538 assert(PyTuple_CheckExact(operand1));
5539 CHECK_OBJECT(operand2);
5541 PyTypeObject *type2 = Py_TYPE(operand2);
5543#if defined(_MSC_VER)
5544#pragma warning(push)
5545#pragma warning(disable : 4101)
5547 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5548 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5549#if defined(_MSC_VER)
5553 binaryfunc slot2 = NULL;
5555 if (!(&PyTuple_Type == type2)) {
5558 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
5561 if (slot2 != NULL) {
5562 PyObject *x = slot2(operand1, operand2);
5564 if (x != Py_NotImplemented) {
5566 goto exit_binary_result_object;
5569 Py_DECREF_IMMORTAL(x);
5572#if PYTHON_VERSION < 0x300
5573 if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
5575 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
5578 PyObject *coerced1 = operand1;
5579 PyObject *coerced2 = operand2;
5581 int err = c2(&coerced2, &coerced1);
5583 if (unlikely(err < 0)) {
5584 goto exit_binary_exception;
5588 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5590 if (likely(mv == NULL)) {
5591 binaryfunc slot = mv->nb_multiply;
5593 if (likely(slot != NULL)) {
5594 PyObject *x = slot(coerced1, coerced2);
5596 Py_DECREF(coerced1);
5597 Py_DECREF(coerced2);
5600 goto exit_binary_result_object;
5605 Py_DECREF(coerced1);
5606 Py_DECREF(coerced2);
5612 if (unlikely(!Nuitka_Index_Check(operand2))) {
5613 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
5615 goto exit_binary_exception;
5619 PyObject *index_value = Nuitka_Number_Index(operand2);
5621 if (unlikely(index_value == NULL)) {
5622 goto exit_binary_exception;
5626 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5628 Py_DECREF(index_value);
5631 if (unlikely(count == -1)) {
5632 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type2->tp_name);
5633 goto exit_binary_exception;
5636 ssizeargfunc repeatfunc = PyTuple_Type.tp_as_sequence->sq_repeat;
5637 PyObject *r = (*repeatfunc)(operand1, count);
5640 goto exit_binary_result_object;
5645 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5647exit_binary_result_object:
5650exit_binary_exception:
5654PyObject *BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2) {
5655 return _BINARY_OPERATION_MULT_OBJECT_TUPLE_OBJECT(operand1, operand2);
5659static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {
5660 CHECK_OBJECT(operand1);
5661 CHECK_OBJECT(operand2);
5662 assert(PyList_CheckExact(operand2));
5664 PyTypeObject *type1 = Py_TYPE(operand1);
5666#if defined(_MSC_VER)
5667#pragma warning(push)
5668#pragma warning(disable : 4101)
5670 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5671 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5672#if defined(_MSC_VER)
5677 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
5679 if (slot1 != NULL) {
5680 PyObject *x = slot1(operand1, operand2);
5682 if (x != Py_NotImplemented) {
5684 goto exit_binary_result_object;
5687 Py_DECREF_IMMORTAL(x);
5690#if PYTHON_VERSION < 0x300
5691 if (!NEW_STYLE_NUMBER_TYPE(type1) || !0) {
5693 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
5696 PyObject *coerced1 = operand1;
5697 PyObject *coerced2 = operand2;
5699 int err = c1(&coerced1, &coerced2);
5701 if (unlikely(err < 0)) {
5702 goto exit_binary_exception;
5706 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5708 if (likely(mv == NULL)) {
5709 binaryfunc slot = mv->nb_multiply;
5711 if (likely(slot != NULL)) {
5712 PyObject *x = slot(coerced1, coerced2);
5714 Py_DECREF(coerced1);
5715 Py_DECREF(coerced2);
5718 goto exit_binary_result_object;
5723 Py_DECREF(coerced1);
5724 Py_DECREF(coerced2);
5732 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
5734 if (sq_slot != NULL) {
5735 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
5737 obj_result = result;
5738 goto exit_binary_result_object;
5741 if (unlikely(!Nuitka_Index_Check(operand1))) {
5742 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand1);
5744 goto exit_binary_exception;
5748 PyObject *index_value = Nuitka_Number_Index(operand1);
5750 if (unlikely(index_value == NULL)) {
5751 goto exit_binary_exception;
5755 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5757 Py_DECREF(index_value);
5760 if (unlikely(count == -1)) {
5761 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type1->tp_name);
5762 goto exit_binary_exception;
5765 ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;
5766 PyObject *r = (*repeatfunc)(operand2, count);
5769 goto exit_binary_result_object;
5774 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5776exit_binary_result_object:
5779exit_binary_exception:
5783PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2) {
5784 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_LIST(operand1, operand2);
5788static PyObject *_BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {
5789 CHECK_OBJECT(operand1);
5790 assert(PyList_CheckExact(operand1));
5791 CHECK_OBJECT(operand2);
5793 PyTypeObject *type2 = Py_TYPE(operand2);
5795#if defined(_MSC_VER)
5796#pragma warning(push)
5797#pragma warning(disable : 4101)
5799 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5800 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5801#if defined(_MSC_VER)
5805 binaryfunc slot2 = NULL;
5807 if (!(&PyList_Type == type2)) {
5810 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
5813 if (slot2 != NULL) {
5814 PyObject *x = slot2(operand1, operand2);
5816 if (x != Py_NotImplemented) {
5818 goto exit_binary_result_object;
5821 Py_DECREF_IMMORTAL(x);
5824#if PYTHON_VERSION < 0x300
5825 if (!0 || !NEW_STYLE_NUMBER_TYPE(type2)) {
5827 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
5830 PyObject *coerced1 = operand1;
5831 PyObject *coerced2 = operand2;
5833 int err = c2(&coerced2, &coerced1);
5835 if (unlikely(err < 0)) {
5836 goto exit_binary_exception;
5840 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
5842 if (likely(mv == NULL)) {
5843 binaryfunc slot = mv->nb_multiply;
5845 if (likely(slot != NULL)) {
5846 PyObject *x = slot(coerced1, coerced2);
5848 Py_DECREF(coerced1);
5849 Py_DECREF(coerced2);
5852 goto exit_binary_result_object;
5857 Py_DECREF(coerced1);
5858 Py_DECREF(coerced2);
5864 if (unlikely(!Nuitka_Index_Check(operand2))) {
5865 SET_CURRENT_EXCEPTION_TYPE_COMPLAINT(
"can't multiply sequence by non-int of type '%s'", operand2);
5867 goto exit_binary_exception;
5871 PyObject *index_value = Nuitka_Number_Index(operand2);
5873 if (unlikely(index_value == NULL)) {
5874 goto exit_binary_exception;
5878 Py_ssize_t count = CONVERT_TO_REPEAT_FACTOR(index_value);
5880 Py_DECREF(index_value);
5883 if (unlikely(count == -1)) {
5884 PyErr_Format(PyExc_OverflowError,
"cannot fit '%s' into an index-sized integer", type2->tp_name);
5885 goto exit_binary_exception;
5888 ssizeargfunc repeatfunc = PyList_Type.tp_as_sequence->sq_repeat;
5889 PyObject *r = (*repeatfunc)(operand1, count);
5892 goto exit_binary_result_object;
5897 NUITKA_CANNOT_GET_HERE(
"missing error exit annotation");
5899exit_binary_result_object:
5902exit_binary_exception:
5906PyObject *BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2) {
5907 return _BINARY_OPERATION_MULT_OBJECT_LIST_OBJECT(operand1, operand2);
5911static PyObject *_BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
5912 CHECK_OBJECT(operand1);
5913 CHECK_OBJECT(operand2);
5915#if PYTHON_VERSION < 0x300
5916 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
5920#if defined(_MSC_VER)
5921#pragma warning(push)
5922#pragma warning(disable : 4101)
5924 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5925 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5926 NUITKA_MAY_BE_UNUSED
long clong_result;
5927 NUITKA_MAY_BE_UNUSED
double cfloat_result;
5928#if defined(_MSC_VER)
5932 CHECK_OBJECT(operand1);
5933 assert(PyInt_CheckExact(operand1));
5934 CHECK_OBJECT(operand2);
5935 assert(PyInt_CheckExact(operand2));
5937 const long a = PyInt_AS_LONG(operand1);
5938 const long b = PyInt_AS_LONG(operand2);
5940 const long longprod = (long)((
unsigned long)a * b);
5941 const double doubleprod = (double)a * (
double)b;
5942 const double doubled_longprod = (double)longprod;
5944 if (likely(doubled_longprod == doubleprod)) {
5945 clong_result = longprod;
5946 goto exit_result_ok_clong;
5948 const double diff = doubled_longprod - doubleprod;
5949 const double absdiff = diff >= 0.0 ? diff : -diff;
5950 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
5952 if (likely(32.0 * absdiff <= absprod)) {
5953 clong_result = longprod;
5954 goto exit_result_ok_clong;
5959 PyObject *operand1_object = operand1;
5960 PyObject *operand2_object = operand2;
5962 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
5963 assert(r != Py_NotImplemented);
5966 goto exit_result_object;
5969 exit_result_ok_clong:
5970 result = Nuitka_PyInt_FromLong(clong_result);
5971 goto exit_result_ok;
5974 if (unlikely(obj_result == NULL)) {
5975 goto exit_result_exception;
5977 result = obj_result;
5978 goto exit_result_ok;
5983 exit_result_exception:
5988 PyTypeObject *type1 = Py_TYPE(operand1);
5989 PyTypeObject *type2 = Py_TYPE(operand2);
5991#if defined(_MSC_VER)
5992#pragma warning(push)
5993#pragma warning(disable : 4101)
5995 NUITKA_MAY_BE_UNUSED
bool cbool_result;
5996 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
5997#if defined(_MSC_VER)
6002 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
6003 binaryfunc slot2 = NULL;
6005 if (!(type1 == type2)) {
6008 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
6010 if (slot1 == slot2) {
6015 if (slot1 != NULL) {
6016 if (slot2 != NULL) {
6017 if (Nuitka_Type_IsSubtype(type2, type1)) {
6018 PyObject *x = slot2(operand1, operand2);
6020 if (x != Py_NotImplemented) {
6022 goto exit_binary_result_object;
6025 Py_DECREF_IMMORTAL(x);
6030 PyObject *x = slot1(operand1, operand2);
6032 if (x != Py_NotImplemented) {
6034 goto exit_binary_result_object;
6037 Py_DECREF_IMMORTAL(x);
6040 if (slot2 != NULL) {
6041 PyObject *x = slot2(operand1, operand2);
6043 if (x != Py_NotImplemented) {
6045 goto exit_binary_result_object;
6048 Py_DECREF_IMMORTAL(x);
6051#if PYTHON_VERSION < 0x300
6052 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
6054 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
6057 PyObject *coerced1 = operand1;
6058 PyObject *coerced2 = operand2;
6060 int err = c1(&coerced1, &coerced2);
6062 if (unlikely(err < 0)) {
6063 goto exit_binary_exception;
6067 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6069 if (likely(mv == NULL)) {
6070 binaryfunc slot = mv->nb_multiply;
6072 if (likely(slot != NULL)) {
6073 PyObject *x = slot(coerced1, coerced2);
6075 Py_DECREF(coerced1);
6076 Py_DECREF(coerced2);
6079 goto exit_binary_result_object;
6084 Py_DECREF(coerced1);
6085 Py_DECREF(coerced2);
6089 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
6092 PyObject *coerced1 = operand1;
6093 PyObject *coerced2 = operand2;
6095 int err = c2(&coerced2, &coerced1);
6097 if (unlikely(err < 0)) {
6098 goto exit_binary_exception;
6102 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6104 if (likely(mv == NULL)) {
6105 binaryfunc slot = mv->nb_multiply;
6107 if (likely(slot != NULL)) {
6108 PyObject *x = slot(coerced1, coerced2);
6110 Py_DECREF(coerced1);
6111 Py_DECREF(coerced2);
6114 goto exit_binary_result_object;
6119 Py_DECREF(coerced1);
6120 Py_DECREF(coerced2);
6128 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
6130 if (sq_slot != NULL) {
6131 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
6133 obj_result = result;
6134 goto exit_binary_result_object;
6139 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
6141 if (sq_slot != NULL) {
6142 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
6144 obj_result = result;
6145 goto exit_binary_result_object;
6149 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and '%s'", type1->tp_name, type2->tp_name);
6150 goto exit_binary_exception;
6152exit_binary_result_object:
6155exit_binary_exception:
6159PyObject *BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6160 return _BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(operand1, operand2);
6164static nuitka_bool _BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6165 CHECK_OBJECT(operand1);
6166 CHECK_OBJECT(operand2);
6168#if PYTHON_VERSION < 0x300
6169 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
6173#if defined(_MSC_VER)
6174#pragma warning(push)
6175#pragma warning(disable : 4101)
6177 NUITKA_MAY_BE_UNUSED
bool cbool_result;
6178 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6179 NUITKA_MAY_BE_UNUSED
long clong_result;
6180 NUITKA_MAY_BE_UNUSED
double cfloat_result;
6181#if defined(_MSC_VER)
6185 CHECK_OBJECT(operand1);
6186 assert(PyInt_CheckExact(operand1));
6187 CHECK_OBJECT(operand2);
6188 assert(PyInt_CheckExact(operand2));
6190 const long a = PyInt_AS_LONG(operand1);
6191 const long b = PyInt_AS_LONG(operand2);
6193 const long longprod = (long)((
unsigned long)a * b);
6194 const double doubleprod = (double)a * (
double)b;
6195 const double doubled_longprod = (double)longprod;
6197 if (likely(doubled_longprod == doubleprod)) {
6198 clong_result = longprod;
6199 goto exit_result_ok_clong;
6201 const double diff = doubled_longprod - doubleprod;
6202 const double absdiff = diff >= 0.0 ? diff : -diff;
6203 const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
6205 if (likely(32.0 * absdiff <= absprod)) {
6206 clong_result = longprod;
6207 goto exit_result_ok_clong;
6212 PyObject *operand1_object = operand1;
6213 PyObject *operand2_object = operand2;
6215 PyObject *r = PyLong_Type.tp_as_number->nb_multiply(operand1_object, operand2_object);
6216 assert(r != Py_NotImplemented);
6219 goto exit_result_object;
6222 exit_result_ok_clong:
6223 result = clong_result != 0 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
6224 goto exit_result_ok;
6227 if (unlikely(obj_result == NULL)) {
6228 goto exit_result_exception;
6230 result = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
6231 Py_DECREF(obj_result);
6232 goto exit_result_ok;
6237 exit_result_exception:
6238 return NUITKA_BOOL_EXCEPTION;
6242 PyTypeObject *type1 = Py_TYPE(operand1);
6243 PyTypeObject *type2 = Py_TYPE(operand2);
6245#if defined(_MSC_VER)
6246#pragma warning(push)
6247#pragma warning(disable : 4101)
6249 NUITKA_MAY_BE_UNUSED
bool cbool_result;
6250 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
6251#if defined(_MSC_VER)
6256 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_multiply : NULL;
6257 binaryfunc slot2 = NULL;
6259 if (!(type1 == type2)) {
6262 slot2 = (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_multiply : NULL;
6264 if (slot1 == slot2) {
6269 if (slot1 != NULL) {
6270 if (slot2 != NULL) {
6271 if (Nuitka_Type_IsSubtype(type2, type1)) {
6272 PyObject *x = slot2(operand1, operand2);
6274 if (x != Py_NotImplemented) {
6276 goto exit_binary_result_object;
6279 Py_DECREF_IMMORTAL(x);
6284 PyObject *x = slot1(operand1, operand2);
6286 if (x != Py_NotImplemented) {
6288 goto exit_binary_result_object;
6291 Py_DECREF_IMMORTAL(x);
6294 if (slot2 != NULL) {
6295 PyObject *x = slot2(operand1, operand2);
6297 if (x != Py_NotImplemented) {
6299 goto exit_binary_result_object;
6302 Py_DECREF_IMMORTAL(x);
6305#if PYTHON_VERSION < 0x300
6306 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
6308 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
6311 PyObject *coerced1 = operand1;
6312 PyObject *coerced2 = operand2;
6314 int err = c1(&coerced1, &coerced2);
6316 if (unlikely(err < 0)) {
6317 goto exit_binary_exception;
6321 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6323 if (likely(mv == NULL)) {
6324 binaryfunc slot = mv->nb_multiply;
6326 if (likely(slot != NULL)) {
6327 PyObject *x = slot(coerced1, coerced2);
6329 Py_DECREF(coerced1);
6330 Py_DECREF(coerced2);
6333 goto exit_binary_result_object;
6338 Py_DECREF(coerced1);
6339 Py_DECREF(coerced2);
6343 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
6346 PyObject *coerced1 = operand1;
6347 PyObject *coerced2 = operand2;
6349 int err = c2(&coerced2, &coerced1);
6351 if (unlikely(err < 0)) {
6352 goto exit_binary_exception;
6356 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
6358 if (likely(mv == NULL)) {
6359 binaryfunc slot = mv->nb_multiply;
6361 if (likely(slot != NULL)) {
6362 PyObject *x = slot(coerced1, coerced2);
6364 Py_DECREF(coerced1);
6365 Py_DECREF(coerced2);
6368 goto exit_binary_result_object;
6373 Py_DECREF(coerced1);
6374 Py_DECREF(coerced2);
6382 ssizeargfunc sq_slot = type1->tp_as_sequence != NULL ? type1->tp_as_sequence->sq_repeat : NULL;
6384 if (sq_slot != NULL) {
6385 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand1, operand2);
6387 obj_result = result;
6388 goto exit_binary_result_object;
6393 ssizeargfunc sq_slot = type2->tp_as_sequence != NULL ? type2->tp_as_sequence->sq_repeat : NULL;
6395 if (sq_slot != NULL) {
6396 PyObject *result = SEQUENCE_REPEAT(sq_slot, operand2, operand1);
6398 obj_result = result;
6399 goto exit_binary_result_object;
6403 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for *: '%s' and '%s'", type1->tp_name, type2->tp_name);
6404 goto exit_binary_exception;
6406exit_binary_result_object:
6407 if (unlikely(obj_result == NULL)) {
6408 return NUITKA_BOOL_EXCEPTION;
6412 nuitka_bool r = CHECK_IF_TRUE(obj_result) ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
6413 Py_DECREF(obj_result);
6417exit_binary_exception:
6418 return NUITKA_BOOL_EXCEPTION;
6421nuitka_bool BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
6422 return _BINARY_OPERATION_MULT_NBOOL_OBJECT_OBJECT(operand1, operand2);