Path: blob/main/python/bench/src/cython/numbers.c
1398 views
/* Generated by Cython 0.29.32 */12/* BEGIN: Cython Metadata3{4"distutils": {5"name": "numbers",6"sources": [7"numbers.pyx"8]9},10"module_name": "numbers"11}12END: Cython Metadata */1314#ifndef PY_SSIZE_T_CLEAN15#define PY_SSIZE_T_CLEAN16#endif /* PY_SSIZE_T_CLEAN */17#include "Python.h"18#ifndef Py_PYTHON_H19#error Python headers needed to compile C extensions, please install development version of Python.20#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)21#error Cython requires Python 2.6+ or Python 3.3+.22#else23#define CYTHON_ABI "0_29_32"24#define CYTHON_HEX_VERSION 0x001D20F025#define CYTHON_FUTURE_DIVISION 026#include <stddef.h>27#ifndef offsetof28#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )29#endif30#if !defined(WIN32) && !defined(MS_WINDOWS)31#ifndef __stdcall32#define __stdcall33#endif34#ifndef __cdecl35#define __cdecl36#endif37#ifndef __fastcall38#define __fastcall39#endif40#endif41#ifndef DL_IMPORT42#define DL_IMPORT(t) t43#endif44#ifndef DL_EXPORT45#define DL_EXPORT(t) t46#endif47#define __PYX_COMMA ,48#ifndef HAVE_LONG_LONG49#if PY_VERSION_HEX >= 0x0207000050#define HAVE_LONG_LONG51#endif52#endif53#ifndef PY_LONG_LONG54#define PY_LONG_LONG LONG_LONG55#endif56#ifndef Py_HUGE_VAL57#define Py_HUGE_VAL HUGE_VAL58#endif59#ifdef PYPY_VERSION60#define CYTHON_COMPILING_IN_PYPY 161#define CYTHON_COMPILING_IN_PYSTON 062#define CYTHON_COMPILING_IN_CPYTHON 063#define CYTHON_COMPILING_IN_NOGIL 064#undef CYTHON_USE_TYPE_SLOTS65#define CYTHON_USE_TYPE_SLOTS 066#undef CYTHON_USE_PYTYPE_LOOKUP67#define CYTHON_USE_PYTYPE_LOOKUP 068#if PY_VERSION_HEX < 0x0305000069#undef CYTHON_USE_ASYNC_SLOTS70#define CYTHON_USE_ASYNC_SLOTS 071#elif !defined(CYTHON_USE_ASYNC_SLOTS)72#define CYTHON_USE_ASYNC_SLOTS 173#endif74#undef CYTHON_USE_PYLIST_INTERNALS75#define CYTHON_USE_PYLIST_INTERNALS 076#undef CYTHON_USE_UNICODE_INTERNALS77#define CYTHON_USE_UNICODE_INTERNALS 078#undef CYTHON_USE_UNICODE_WRITER79#define CYTHON_USE_UNICODE_WRITER 080#undef CYTHON_USE_PYLONG_INTERNALS81#define CYTHON_USE_PYLONG_INTERNALS 082#undef CYTHON_AVOID_BORROWED_REFS83#define CYTHON_AVOID_BORROWED_REFS 184#undef CYTHON_ASSUME_SAFE_MACROS85#define CYTHON_ASSUME_SAFE_MACROS 086#undef CYTHON_UNPACK_METHODS87#define CYTHON_UNPACK_METHODS 088#undef CYTHON_FAST_THREAD_STATE89#define CYTHON_FAST_THREAD_STATE 090#undef CYTHON_FAST_PYCALL91#define CYTHON_FAST_PYCALL 092#undef CYTHON_PEP489_MULTI_PHASE_INIT93#define CYTHON_PEP489_MULTI_PHASE_INIT 094#undef CYTHON_USE_TP_FINALIZE95#define CYTHON_USE_TP_FINALIZE 096#undef CYTHON_USE_DICT_VERSIONS97#define CYTHON_USE_DICT_VERSIONS 098#undef CYTHON_USE_EXC_INFO_STACK99#define CYTHON_USE_EXC_INFO_STACK 0100#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC101#define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)102#endif103#elif defined(PYSTON_VERSION)104#define CYTHON_COMPILING_IN_PYPY 0105#define CYTHON_COMPILING_IN_PYSTON 1106#define CYTHON_COMPILING_IN_CPYTHON 0107#define CYTHON_COMPILING_IN_NOGIL 0108#ifndef CYTHON_USE_TYPE_SLOTS109#define CYTHON_USE_TYPE_SLOTS 1110#endif111#undef CYTHON_USE_PYTYPE_LOOKUP112#define CYTHON_USE_PYTYPE_LOOKUP 0113#undef CYTHON_USE_ASYNC_SLOTS114#define CYTHON_USE_ASYNC_SLOTS 0115#undef CYTHON_USE_PYLIST_INTERNALS116#define CYTHON_USE_PYLIST_INTERNALS 0117#ifndef CYTHON_USE_UNICODE_INTERNALS118#define CYTHON_USE_UNICODE_INTERNALS 1119#endif120#undef CYTHON_USE_UNICODE_WRITER121#define CYTHON_USE_UNICODE_WRITER 0122#undef CYTHON_USE_PYLONG_INTERNALS123#define CYTHON_USE_PYLONG_INTERNALS 0124#ifndef CYTHON_AVOID_BORROWED_REFS125#define CYTHON_AVOID_BORROWED_REFS 0126#endif127#ifndef CYTHON_ASSUME_SAFE_MACROS128#define CYTHON_ASSUME_SAFE_MACROS 1129#endif130#ifndef CYTHON_UNPACK_METHODS131#define CYTHON_UNPACK_METHODS 1132#endif133#undef CYTHON_FAST_THREAD_STATE134#define CYTHON_FAST_THREAD_STATE 0135#undef CYTHON_FAST_PYCALL136#define CYTHON_FAST_PYCALL 0137#undef CYTHON_PEP489_MULTI_PHASE_INIT138#define CYTHON_PEP489_MULTI_PHASE_INIT 0139#undef CYTHON_USE_TP_FINALIZE140#define CYTHON_USE_TP_FINALIZE 0141#undef CYTHON_USE_DICT_VERSIONS142#define CYTHON_USE_DICT_VERSIONS 0143#undef CYTHON_USE_EXC_INFO_STACK144#define CYTHON_USE_EXC_INFO_STACK 0145#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC146#define CYTHON_UPDATE_DESCRIPTOR_DOC 0147#endif148#elif defined(PY_NOGIL)149#define CYTHON_COMPILING_IN_PYPY 0150#define CYTHON_COMPILING_IN_PYSTON 0151#define CYTHON_COMPILING_IN_CPYTHON 0152#define CYTHON_COMPILING_IN_NOGIL 1153#ifndef CYTHON_USE_TYPE_SLOTS154#define CYTHON_USE_TYPE_SLOTS 1155#endif156#undef CYTHON_USE_PYTYPE_LOOKUP157#define CYTHON_USE_PYTYPE_LOOKUP 0158#ifndef CYTHON_USE_ASYNC_SLOTS159#define CYTHON_USE_ASYNC_SLOTS 1160#endif161#undef CYTHON_USE_PYLIST_INTERNALS162#define CYTHON_USE_PYLIST_INTERNALS 0163#ifndef CYTHON_USE_UNICODE_INTERNALS164#define CYTHON_USE_UNICODE_INTERNALS 1165#endif166#undef CYTHON_USE_UNICODE_WRITER167#define CYTHON_USE_UNICODE_WRITER 0168#undef CYTHON_USE_PYLONG_INTERNALS169#define CYTHON_USE_PYLONG_INTERNALS 0170#ifndef CYTHON_AVOID_BORROWED_REFS171#define CYTHON_AVOID_BORROWED_REFS 0172#endif173#ifndef CYTHON_ASSUME_SAFE_MACROS174#define CYTHON_ASSUME_SAFE_MACROS 1175#endif176#ifndef CYTHON_UNPACK_METHODS177#define CYTHON_UNPACK_METHODS 1178#endif179#undef CYTHON_FAST_THREAD_STATE180#define CYTHON_FAST_THREAD_STATE 0181#undef CYTHON_FAST_PYCALL182#define CYTHON_FAST_PYCALL 0183#ifndef CYTHON_PEP489_MULTI_PHASE_INIT184#define CYTHON_PEP489_MULTI_PHASE_INIT 1185#endif186#ifndef CYTHON_USE_TP_FINALIZE187#define CYTHON_USE_TP_FINALIZE 1188#endif189#undef CYTHON_USE_DICT_VERSIONS190#define CYTHON_USE_DICT_VERSIONS 0191#undef CYTHON_USE_EXC_INFO_STACK192#define CYTHON_USE_EXC_INFO_STACK 0193#else194#define CYTHON_COMPILING_IN_PYPY 0195#define CYTHON_COMPILING_IN_PYSTON 0196#define CYTHON_COMPILING_IN_CPYTHON 1197#define CYTHON_COMPILING_IN_NOGIL 0198#ifndef CYTHON_USE_TYPE_SLOTS199#define CYTHON_USE_TYPE_SLOTS 1200#endif201#if PY_VERSION_HEX < 0x02070000202#undef CYTHON_USE_PYTYPE_LOOKUP203#define CYTHON_USE_PYTYPE_LOOKUP 0204#elif !defined(CYTHON_USE_PYTYPE_LOOKUP)205#define CYTHON_USE_PYTYPE_LOOKUP 1206#endif207#if PY_MAJOR_VERSION < 3208#undef CYTHON_USE_ASYNC_SLOTS209#define CYTHON_USE_ASYNC_SLOTS 0210#elif !defined(CYTHON_USE_ASYNC_SLOTS)211#define CYTHON_USE_ASYNC_SLOTS 1212#endif213#if PY_VERSION_HEX < 0x02070000214#undef CYTHON_USE_PYLONG_INTERNALS215#define CYTHON_USE_PYLONG_INTERNALS 0216#elif !defined(CYTHON_USE_PYLONG_INTERNALS)217#define CYTHON_USE_PYLONG_INTERNALS 1218#endif219#ifndef CYTHON_USE_PYLIST_INTERNALS220#define CYTHON_USE_PYLIST_INTERNALS 1221#endif222#ifndef CYTHON_USE_UNICODE_INTERNALS223#define CYTHON_USE_UNICODE_INTERNALS 1224#endif225#if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2226#undef CYTHON_USE_UNICODE_WRITER227#define CYTHON_USE_UNICODE_WRITER 0228#elif !defined(CYTHON_USE_UNICODE_WRITER)229#define CYTHON_USE_UNICODE_WRITER 1230#endif231#ifndef CYTHON_AVOID_BORROWED_REFS232#define CYTHON_AVOID_BORROWED_REFS 0233#endif234#ifndef CYTHON_ASSUME_SAFE_MACROS235#define CYTHON_ASSUME_SAFE_MACROS 1236#endif237#ifndef CYTHON_UNPACK_METHODS238#define CYTHON_UNPACK_METHODS 1239#endif240#if PY_VERSION_HEX >= 0x030B00A4241#undef CYTHON_FAST_THREAD_STATE242#define CYTHON_FAST_THREAD_STATE 0243#elif !defined(CYTHON_FAST_THREAD_STATE)244#define CYTHON_FAST_THREAD_STATE 1245#endif246#ifndef CYTHON_FAST_PYCALL247#define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)248#endif249#ifndef CYTHON_PEP489_MULTI_PHASE_INIT250#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)251#endif252#ifndef CYTHON_USE_TP_FINALIZE253#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)254#endif255#ifndef CYTHON_USE_DICT_VERSIONS256#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)257#endif258#if PY_VERSION_HEX >= 0x030B00A4259#undef CYTHON_USE_EXC_INFO_STACK260#define CYTHON_USE_EXC_INFO_STACK 0261#elif !defined(CYTHON_USE_EXC_INFO_STACK)262#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)263#endif264#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC265#define CYTHON_UPDATE_DESCRIPTOR_DOC 1266#endif267#endif268#if !defined(CYTHON_FAST_PYCCALL)269#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)270#endif271#if CYTHON_USE_PYLONG_INTERNALS272#if PY_MAJOR_VERSION < 3273#include "longintrepr.h"274#endif275#undef SHIFT276#undef BASE277#undef MASK278#ifdef SIZEOF_VOID_P279enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };280#endif281#endif282#ifndef __has_attribute283#define __has_attribute(x) 0284#endif285#ifndef __has_cpp_attribute286#define __has_cpp_attribute(x) 0287#endif288#ifndef CYTHON_RESTRICT289#if defined(__GNUC__)290#define CYTHON_RESTRICT __restrict__291#elif defined(_MSC_VER) && _MSC_VER >= 1400292#define CYTHON_RESTRICT __restrict293#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L294#define CYTHON_RESTRICT restrict295#else296#define CYTHON_RESTRICT297#endif298#endif299#ifndef CYTHON_UNUSED300# if defined(__GNUC__)301# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))302# define CYTHON_UNUSED __attribute__ ((__unused__))303# else304# define CYTHON_UNUSED305# endif306# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))307# define CYTHON_UNUSED __attribute__ ((__unused__))308# else309# define CYTHON_UNUSED310# endif311#endif312#ifndef CYTHON_MAYBE_UNUSED_VAR313# if defined(__cplusplus)314template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }315# else316# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)317# endif318#endif319#ifndef CYTHON_NCP_UNUSED320# if CYTHON_COMPILING_IN_CPYTHON321# define CYTHON_NCP_UNUSED322# else323# define CYTHON_NCP_UNUSED CYTHON_UNUSED324# endif325#endif326#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)327#ifdef _MSC_VER328#ifndef _MSC_STDINT_H_329#if _MSC_VER < 1300330typedef unsigned char uint8_t;331typedef unsigned int uint32_t;332#else333typedef unsigned __int8 uint8_t;334typedef unsigned __int32 uint32_t;335#endif336#endif337#else338#include <stdint.h>339#endif340#ifndef CYTHON_FALLTHROUGH341#if defined(__cplusplus) && __cplusplus >= 201103L342#if __has_cpp_attribute(fallthrough)343#define CYTHON_FALLTHROUGH [[fallthrough]]344#elif __has_cpp_attribute(clang::fallthrough)345#define CYTHON_FALLTHROUGH [[clang::fallthrough]]346#elif __has_cpp_attribute(gnu::fallthrough)347#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]348#endif349#endif350#ifndef CYTHON_FALLTHROUGH351#if __has_attribute(fallthrough)352#define CYTHON_FALLTHROUGH __attribute__((fallthrough))353#else354#define CYTHON_FALLTHROUGH355#endif356#endif357#if defined(__clang__ ) && defined(__apple_build_version__)358#if __apple_build_version__ < 7000000359#undef CYTHON_FALLTHROUGH360#define CYTHON_FALLTHROUGH361#endif362#endif363#endif364365#ifndef CYTHON_INLINE366#if defined(__clang__)367#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))368#elif defined(__GNUC__)369#define CYTHON_INLINE __inline__370#elif defined(_MSC_VER)371#define CYTHON_INLINE __inline372#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L373#define CYTHON_INLINE inline374#else375#define CYTHON_INLINE376#endif377#endif378379#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)380#define Py_OptimizeFlag 0381#endif382#define __PYX_BUILD_PY_SSIZE_T "n"383#define CYTHON_FORMAT_SSIZE_T "z"384#if PY_MAJOR_VERSION < 3385#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"386#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\387PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)388#define __Pyx_DefaultClassType PyClass_Type389#else390#define __Pyx_BUILTIN_MODULE_NAME "builtins"391#define __Pyx_DefaultClassType PyType_Type392#if PY_VERSION_HEX >= 0x030B00A1393static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,394PyObject *code, PyObject *c, PyObject* n, PyObject *v,395PyObject *fv, PyObject *cell, PyObject* fn,396PyObject *name, int fline, PyObject *lnos) {397PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;398PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;399const char *fn_cstr=NULL;400const char *name_cstr=NULL;401PyCodeObject* co=NULL;402PyObject *type, *value, *traceback;403PyErr_Fetch(&type, &value, &traceback);404if (!(kwds=PyDict_New())) goto end;405if (!(argcount=PyLong_FromLong(a))) goto end;406if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;407if (!(posonlyargcount=PyLong_FromLong(0))) goto end;408if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;409if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;410if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;411if (!(nlocals=PyLong_FromLong(l))) goto end;412if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;413if (!(stacksize=PyLong_FromLong(s))) goto end;414if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;415if (!(flags=PyLong_FromLong(f))) goto end;416if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;417if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;418if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;419if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;420if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;421if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;422if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;423if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;424if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;425if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;426if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;427if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;428if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here429if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;430Py_XDECREF((PyObject*)co);431co = (PyCodeObject*)call_result;432call_result = NULL;433if (0) {434cleanup_code_too:435Py_XDECREF((PyObject*)co);436co = NULL;437}438end:439Py_XDECREF(kwds);440Py_XDECREF(argcount);441Py_XDECREF(posonlyargcount);442Py_XDECREF(kwonlyargcount);443Py_XDECREF(nlocals);444Py_XDECREF(stacksize);445Py_XDECREF(replace);446Py_XDECREF(call_result);447Py_XDECREF(empty);448if (type) {449PyErr_Restore(type, value, traceback);450}451return co;452}453#else454#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\455PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)456#endif457#define __Pyx_DefaultClassType PyType_Type458#endif459#ifndef Py_TPFLAGS_CHECKTYPES460#define Py_TPFLAGS_CHECKTYPES 0461#endif462#ifndef Py_TPFLAGS_HAVE_INDEX463#define Py_TPFLAGS_HAVE_INDEX 0464#endif465#ifndef Py_TPFLAGS_HAVE_NEWBUFFER466#define Py_TPFLAGS_HAVE_NEWBUFFER 0467#endif468#ifndef Py_TPFLAGS_HAVE_FINALIZE469#define Py_TPFLAGS_HAVE_FINALIZE 0470#endif471#ifndef METH_STACKLESS472#define METH_STACKLESS 0473#endif474#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)475#ifndef METH_FASTCALL476#define METH_FASTCALL 0x80477#endif478typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);479typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,480Py_ssize_t nargs, PyObject *kwnames);481#else482#define __Pyx_PyCFunctionFast _PyCFunctionFast483#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords484#endif485#if CYTHON_FAST_PYCCALL486#define __Pyx_PyFastCFunction_Check(func)\487((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))488#else489#define __Pyx_PyFastCFunction_Check(func) 0490#endif491#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)492#define PyObject_Malloc(s) PyMem_Malloc(s)493#define PyObject_Free(p) PyMem_Free(p)494#define PyObject_Realloc(p) PyMem_Realloc(p)495#endif496#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1497#define PyMem_RawMalloc(n) PyMem_Malloc(n)498#define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)499#define PyMem_RawFree(p) PyMem_Free(p)500#endif501#if CYTHON_COMPILING_IN_PYSTON502#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)503#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)504#else505#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)506#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)507#endif508#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000509#define __Pyx_PyThreadState_Current PyThreadState_GET()510#elif PY_VERSION_HEX >= 0x03060000511#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()512#elif PY_VERSION_HEX >= 0x03000000513#define __Pyx_PyThreadState_Current PyThreadState_GET()514#else515#define __Pyx_PyThreadState_Current _PyThreadState_Current516#endif517#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)518#include "pythread.h"519#define Py_tss_NEEDS_INIT 0520typedef int Py_tss_t;521static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {522*key = PyThread_create_key();523return 0;524}525static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {526Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));527*key = Py_tss_NEEDS_INIT;528return key;529}530static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {531PyObject_Free(key);532}533static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {534return *key != Py_tss_NEEDS_INIT;535}536static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {537PyThread_delete_key(*key);538*key = Py_tss_NEEDS_INIT;539}540static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {541return PyThread_set_key_value(*key, value);542}543static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {544return PyThread_get_key_value(*key);545}546#endif547#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)548#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))549#else550#define __Pyx_PyDict_NewPresized(n) PyDict_New()551#endif552#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION553#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)554#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)555#else556#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)557#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)558#endif559#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS560#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)561#else562#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)563#endif564#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)565#define CYTHON_PEP393_ENABLED 1566#if defined(PyUnicode_IS_READY)567#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\5680 : _PyUnicode_Ready((PyObject *)(op)))569#else570#define __Pyx_PyUnicode_READY(op) (0)571#endif572#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)573#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)574#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)575#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)576#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)577#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)578#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)579#if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)580#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000581#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))582#else583#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))584#endif585#else586#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))587#endif588#else589#define CYTHON_PEP393_ENABLED 0590#define PyUnicode_1BYTE_KIND 1591#define PyUnicode_2BYTE_KIND 2592#define PyUnicode_4BYTE_KIND 4593#define __Pyx_PyUnicode_READY(op) (0)594#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)595#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))596#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)597#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))598#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))599#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))600#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)601#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))602#endif603#if CYTHON_COMPILING_IN_PYPY604#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)605#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)606#else607#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)608#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\609PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))610#endif611#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)612#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)613#endif614#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)615#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)616#endif617#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)618#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)619#endif620#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))621#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))622#if PY_MAJOR_VERSION >= 3623#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)624#else625#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)626#endif627#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)628#define PyObject_ASCII(o) PyObject_Repr(o)629#endif630#if PY_MAJOR_VERSION >= 3631#define PyBaseString_Type PyUnicode_Type632#define PyStringObject PyUnicodeObject633#define PyString_Type PyUnicode_Type634#define PyString_Check PyUnicode_Check635#define PyString_CheckExact PyUnicode_CheckExact636#ifndef PyObject_Unicode637#define PyObject_Unicode PyObject_Str638#endif639#endif640#if PY_MAJOR_VERSION >= 3641#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)642#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)643#else644#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))645#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))646#endif647#ifndef PySet_CheckExact648#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)649#endif650#if PY_VERSION_HEX >= 0x030900A4651#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)652#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)653#else654#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)655#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)656#endif657#if CYTHON_ASSUME_SAFE_MACROS658#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)659#else660#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)661#endif662#if PY_MAJOR_VERSION >= 3663#define PyIntObject PyLongObject664#define PyInt_Type PyLong_Type665#define PyInt_Check(op) PyLong_Check(op)666#define PyInt_CheckExact(op) PyLong_CheckExact(op)667#define PyInt_FromString PyLong_FromString668#define PyInt_FromUnicode PyLong_FromUnicode669#define PyInt_FromLong PyLong_FromLong670#define PyInt_FromSize_t PyLong_FromSize_t671#define PyInt_FromSsize_t PyLong_FromSsize_t672#define PyInt_AsLong PyLong_AsLong673#define PyInt_AS_LONG PyLong_AS_LONG674#define PyInt_AsSsize_t PyLong_AsSsize_t675#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask676#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask677#define PyNumber_Int PyNumber_Long678#endif679#if PY_MAJOR_VERSION >= 3680#define PyBoolObject PyLongObject681#endif682#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY683#ifndef PyUnicode_InternFromString684#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)685#endif686#endif687#if PY_VERSION_HEX < 0x030200A4688typedef long Py_hash_t;689#define __Pyx_PyInt_FromHash_t PyInt_FromLong690#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t691#else692#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t693#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t694#endif695#if PY_MAJOR_VERSION >= 3696#define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))697#else698#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)699#endif700#if CYTHON_USE_ASYNC_SLOTS701#if PY_VERSION_HEX >= 0x030500B1702#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods703#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)704#else705#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))706#endif707#else708#define __Pyx_PyType_AsAsync(obj) NULL709#endif710#ifndef __Pyx_PyAsyncMethodsStruct711typedef struct {712unaryfunc am_await;713unaryfunc am_aiter;714unaryfunc am_anext;715} __Pyx_PyAsyncMethodsStruct;716#endif717718#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)719#if !defined(_USE_MATH_DEFINES)720#define _USE_MATH_DEFINES721#endif722#endif723#include <math.h>724#ifdef NAN725#define __PYX_NAN() ((float) NAN)726#else727static CYTHON_INLINE float __PYX_NAN() {728float value;729memset(&value, 0xFF, sizeof(value));730return value;731}732#endif733#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)734#define __Pyx_truncl trunc735#else736#define __Pyx_truncl truncl737#endif738739#define __PYX_MARK_ERR_POS(f_index, lineno) \740{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }741#define __PYX_ERR(f_index, lineno, Ln_error) \742{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }743744#ifndef __PYX_EXTERN_C745#ifdef __cplusplus746#define __PYX_EXTERN_C extern "C"747#else748#define __PYX_EXTERN_C extern749#endif750#endif751752#define __PYX_HAVE__numbers753#define __PYX_HAVE_API__numbers754/* Early includes */755#ifdef _OPENMP756#include <omp.h>757#endif /* _OPENMP */758759#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)760#define CYTHON_WITHOUT_ASSERTIONS761#endif762763typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;764const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;765766#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0767#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0768#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)769#define __PYX_DEFAULT_STRING_ENCODING ""770#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString771#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize772#define __Pyx_uchar_cast(c) ((unsigned char)c)773#define __Pyx_long_cast(x) ((long)x)774#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\775(sizeof(type) < sizeof(Py_ssize_t)) ||\776(sizeof(type) > sizeof(Py_ssize_t) &&\777likely(v < (type)PY_SSIZE_T_MAX ||\778v == (type)PY_SSIZE_T_MAX) &&\779(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\780v == (type)PY_SSIZE_T_MIN))) ||\781(sizeof(type) == sizeof(Py_ssize_t) &&\782(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\783v == (type)PY_SSIZE_T_MAX))) )784static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {785return (size_t) i < (size_t) limit;786}787#if defined (__cplusplus) && __cplusplus >= 201103L788#include <cstdlib>789#define __Pyx_sst_abs(value) std::abs(value)790#elif SIZEOF_INT >= SIZEOF_SIZE_T791#define __Pyx_sst_abs(value) abs(value)792#elif SIZEOF_LONG >= SIZEOF_SIZE_T793#define __Pyx_sst_abs(value) labs(value)794#elif defined (_MSC_VER)795#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))796#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L797#define __Pyx_sst_abs(value) llabs(value)798#elif defined (__GNUC__)799#define __Pyx_sst_abs(value) __builtin_llabs(value)800#else801#define __Pyx_sst_abs(value) ((value<0) ? -value : value)802#endif803static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);804static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);805#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))806#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)807#define __Pyx_PyBytes_FromString PyBytes_FromString808#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize809static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);810#if PY_MAJOR_VERSION < 3811#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString812#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize813#else814#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString815#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize816#endif817#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))818#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))819#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))820#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))821#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))822#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))823#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))824#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))825#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))826#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))827#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))828#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)829#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)830#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)831#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)832#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)833static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {834const Py_UNICODE *u_end = u;835while (*u_end++) ;836return (size_t)(u_end - u - 1);837}838#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))839#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode840#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode841#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)842#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)843static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);844static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);845static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);846static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);847#define __Pyx_PySequence_Tuple(obj)\848(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))849static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);850static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);851static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);852#if CYTHON_ASSUME_SAFE_MACROS853#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))854#else855#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)856#endif857#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))858#if PY_MAJOR_VERSION >= 3859#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))860#else861#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))862#endif863#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))864#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII865static int __Pyx_sys_getdefaultencoding_not_ascii;866static int __Pyx_init_sys_getdefaultencoding_params(void) {867PyObject* sys;868PyObject* default_encoding = NULL;869PyObject* ascii_chars_u = NULL;870PyObject* ascii_chars_b = NULL;871const char* default_encoding_c;872sys = PyImport_ImportModule("sys");873if (!sys) goto bad;874default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);875Py_DECREF(sys);876if (!default_encoding) goto bad;877default_encoding_c = PyBytes_AsString(default_encoding);878if (!default_encoding_c) goto bad;879if (strcmp(default_encoding_c, "ascii") == 0) {880__Pyx_sys_getdefaultencoding_not_ascii = 0;881} else {882char ascii_chars[128];883int c;884for (c = 0; c < 128; c++) {885ascii_chars[c] = c;886}887__Pyx_sys_getdefaultencoding_not_ascii = 1;888ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);889if (!ascii_chars_u) goto bad;890ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);891if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {892PyErr_Format(893PyExc_ValueError,894"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",895default_encoding_c);896goto bad;897}898Py_DECREF(ascii_chars_u);899Py_DECREF(ascii_chars_b);900}901Py_DECREF(default_encoding);902return 0;903bad:904Py_XDECREF(default_encoding);905Py_XDECREF(ascii_chars_u);906Py_XDECREF(ascii_chars_b);907return -1;908}909#endif910#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3911#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)912#else913#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)914#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT915static char* __PYX_DEFAULT_STRING_ENCODING;916static int __Pyx_init_sys_getdefaultencoding_params(void) {917PyObject* sys;918PyObject* default_encoding = NULL;919char* default_encoding_c;920sys = PyImport_ImportModule("sys");921if (!sys) goto bad;922default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);923Py_DECREF(sys);924if (!default_encoding) goto bad;925default_encoding_c = PyBytes_AsString(default_encoding);926if (!default_encoding_c) goto bad;927__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);928if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;929strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);930Py_DECREF(default_encoding);931return 0;932bad:933Py_XDECREF(default_encoding);934return -1;935}936#endif937#endif938939940/* Test for GCC > 2.95 */941#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))942#define likely(x) __builtin_expect(!!(x), 1)943#define unlikely(x) __builtin_expect(!!(x), 0)944#else /* !__GNUC__ or GCC < 2.95 */945#define likely(x) (x)946#define unlikely(x) (x)947#endif /* __GNUC__ */948static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }949950static PyObject *__pyx_m = NULL;951static PyObject *__pyx_d;952static PyObject *__pyx_b;953static PyObject *__pyx_cython_runtime = NULL;954static PyObject *__pyx_empty_tuple;955static PyObject *__pyx_empty_bytes;956static PyObject *__pyx_empty_unicode;957static int __pyx_lineno;958static int __pyx_clineno = 0;959static const char * __pyx_cfilenm= __FILE__;960static const char *__pyx_filename;961962963static const char *__pyx_f[] = {964"numbers.pyx",965"stringsource",966};967968/*--- Type declarations ---*/969struct __pyx_obj_7numbers_A;970971/* "numbers.pyx":12972* register("pi(10**5)", pi)973*974* cdef class A: # <<<<<<<<<<<<<<975* cdef int i976* def __init__(self, int i):977*/978struct __pyx_obj_7numbers_A {979PyObject_HEAD980int i;981};982983984/* --- Runtime support code (head) --- */985/* Refnanny.proto */986#ifndef CYTHON_REFNANNY987#define CYTHON_REFNANNY 0988#endif989#if CYTHON_REFNANNY990typedef struct {991void (*INCREF)(void*, PyObject*, int);992void (*DECREF)(void*, PyObject*, int);993void (*GOTREF)(void*, PyObject*, int);994void (*GIVEREF)(void*, PyObject*, int);995void* (*SetupContext)(const char*, int, const char*);996void (*FinishContext)(void**);997} __Pyx_RefNannyAPIStruct;998static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;999static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);1000#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;1001#ifdef WITH_THREAD1002#define __Pyx_RefNannySetupContext(name, acquire_gil)\1003if (acquire_gil) {\1004PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\1005__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\1006PyGILState_Release(__pyx_gilstate_save);\1007} else {\1008__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\1009}1010#else1011#define __Pyx_RefNannySetupContext(name, acquire_gil)\1012__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)1013#endif1014#define __Pyx_RefNannyFinishContext()\1015__Pyx_RefNanny->FinishContext(&__pyx_refnanny)1016#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)1017#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)1018#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)1019#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)1020#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)1021#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)1022#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)1023#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)1024#else1025#define __Pyx_RefNannyDeclarations1026#define __Pyx_RefNannySetupContext(name, acquire_gil)1027#define __Pyx_RefNannyFinishContext()1028#define __Pyx_INCREF(r) Py_INCREF(r)1029#define __Pyx_DECREF(r) Py_DECREF(r)1030#define __Pyx_GOTREF(r)1031#define __Pyx_GIVEREF(r)1032#define __Pyx_XINCREF(r) Py_XINCREF(r)1033#define __Pyx_XDECREF(r) Py_XDECREF(r)1034#define __Pyx_XGOTREF(r)1035#define __Pyx_XGIVEREF(r)1036#endif1037#define __Pyx_XDECREF_SET(r, v) do {\1038PyObject *tmp = (PyObject *) r;\1039r = v; __Pyx_XDECREF(tmp);\1040} while (0)1041#define __Pyx_DECREF_SET(r, v) do {\1042PyObject *tmp = (PyObject *) r;\1043r = v; __Pyx_DECREF(tmp);\1044} while (0)1045#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)1046#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)10471048/* PyObjectGetAttrStr.proto */1049#if CYTHON_USE_TYPE_SLOTS1050static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);1051#else1052#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)1053#endif10541055/* GetBuiltinName.proto */1056static PyObject *__Pyx_GetBuiltinName(PyObject *name);10571058/* RaiseDoubleKeywords.proto */1059static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);10601061/* ParseKeywords.proto */1062static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\1063PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\1064const char* function_name);10651066/* RaiseArgTupleInvalid.proto */1067static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,1068Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);10691070/* PyIntCompare.proto */1071static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);10721073/* PyDictVersioning.proto */1074#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS1075#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)1076#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)1077#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\1078(version_var) = __PYX_GET_DICT_VERSION(dict);\1079(cache_var) = (value);1080#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\1081static PY_UINT64_T __pyx_dict_version = 0;\1082static PyObject *__pyx_dict_cached_value = NULL;\1083if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\1084(VAR) = __pyx_dict_cached_value;\1085} else {\1086(VAR) = __pyx_dict_cached_value = (LOOKUP);\1087__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\1088}\1089}1090static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);1091static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);1092static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);1093#else1094#define __PYX_GET_DICT_VERSION(dict) (0)1095#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)1096#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);1097#endif10981099/* GetModuleGlobalName.proto */1100#if CYTHON_USE_DICT_VERSIONS1101#define __Pyx_GetModuleGlobalName(var, name) {\1102static PY_UINT64_T __pyx_dict_version = 0;\1103static PyObject *__pyx_dict_cached_value = NULL;\1104(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\1105(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\1106__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\1107}1108#define __Pyx_GetModuleGlobalNameUncached(var, name) {\1109PY_UINT64_T __pyx_dict_version;\1110PyObject *__pyx_dict_cached_value;\1111(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\1112}1113static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);1114#else1115#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)1116#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)1117static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);1118#endif11191120/* PyCFunctionFastCall.proto */1121#if CYTHON_FAST_PYCCALL1122static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);1123#else1124#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)1125#endif11261127/* PyFunctionFastCall.proto */1128#if CYTHON_FAST_PYCALL1129#define __Pyx_PyFunction_FastCall(func, args, nargs)\1130__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)1131#if 1 || PY_VERSION_HEX < 0x030600B11132static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);1133#else1134#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)1135#endif1136#define __Pyx_BUILD_ASSERT_EXPR(cond)\1137(sizeof(char [1 - 2*!(cond)]) - 1)1138#ifndef Py_MEMBER_SIZE1139#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)1140#endif1141#if CYTHON_FAST_PYCALL1142static size_t __pyx_pyframe_localsplus_offset = 0;1143#include "frameobject.h"1144#if PY_VERSION_HEX >= 0x030b00a61145#ifndef Py_BUILD_CORE1146#define Py_BUILD_CORE 11147#endif1148#include "internal/pycore_frame.h"1149#endif1150#define __Pxy_PyFrame_Initialize_Offsets()\1151((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\1152(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))1153#define __Pyx_PyFrame_GetLocalsplus(frame)\1154(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))1155#endif // CYTHON_FAST_PYCALL1156#endif11571158/* PyObjectCall.proto */1159#if CYTHON_COMPILING_IN_CPYTHON1160static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);1161#else1162#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)1163#endif11641165/* PyObjectCall2Args.proto */1166static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);11671168/* PyObjectCallMethO.proto */1169#if CYTHON_COMPILING_IN_CPYTHON1170static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);1171#endif11721173/* PyObjectCallOneArg.proto */1174static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);11751176/* PyErrExceptionMatches.proto */1177#if CYTHON_FAST_THREAD_STATE1178#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)1179static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);1180#else1181#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)1182#endif11831184/* PyThreadStateGet.proto */1185#if CYTHON_FAST_THREAD_STATE1186#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;1187#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;1188#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type1189#else1190#define __Pyx_PyThreadState_declare1191#define __Pyx_PyThreadState_assign1192#define __Pyx_PyErr_Occurred() PyErr_Occurred()1193#endif11941195/* PyErrFetchRestore.proto */1196#if CYTHON_FAST_THREAD_STATE1197#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)1198#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)1199#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)1200#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)1201#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)1202static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);1203static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);1204#if CYTHON_COMPILING_IN_CPYTHON1205#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))1206#else1207#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)1208#endif1209#else1210#define __Pyx_PyErr_Clear() PyErr_Clear()1211#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)1212#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)1213#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)1214#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)1215#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)1216#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)1217#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)1218#endif12191220/* GetAttr.proto */1221static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);12221223/* GetAttr3.proto */1224static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);12251226/* None.proto */1227static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);12281229/* PyObjectCallNoArg.proto */1230#if CYTHON_COMPILING_IN_CPYTHON1231static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);1232#else1233#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)1234#endif12351236/* PyIntBinop.proto */1237#if !CYTHON_COMPILING_IN_PYPY1238static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);1239#else1240#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\1241(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))1242#endif12431244/* GetItemInt.proto */1245#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\1246(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\1247__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\1248(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\1249__Pyx_GetItemInt_Generic(o, to_py_func(i))))1250#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\1251(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\1252__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\1253(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))1254static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,1255int wraparound, int boundscheck);1256#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\1257(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\1258__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\1259(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))1260static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,1261int wraparound, int boundscheck);1262static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);1263static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,1264int is_list, int wraparound, int boundscheck);12651266/* PySequenceContains.proto */1267static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {1268int result = PySequence_Contains(seq, item);1269return unlikely(result < 0) ? result : (result == (eq == Py_EQ));1270}12711272/* Import.proto */1273static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);12741275/* ImportFrom.proto */1276static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);12771278/* RaiseException.proto */1279static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);12801281/* HasAttr.proto */1282static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);12831284/* PyObject_GenericGetAttrNoDict.proto */1285#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x030700001286static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);1287#else1288#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr1289#endif12901291/* PyObject_GenericGetAttr.proto */1292#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x030700001293static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);1294#else1295#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr1296#endif12971298/* PyObjectGetAttrStrNoError.proto */1299static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);13001301/* SetupReduce.proto */1302static int __Pyx_setup_reduce(PyObject* type_obj);13031304/* IncludeStringH.proto */1305#include <string.h>13061307/* BytesEquals.proto */1308static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);13091310/* UnicodeEquals.proto */1311static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);13121313/* StrEquals.proto */1314#if PY_MAJOR_VERSION >= 31315#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals1316#else1317#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals1318#endif13191320/* CLineInTraceback.proto */1321#ifdef CYTHON_CLINE_IN_TRACEBACK1322#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)1323#else1324static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);1325#endif13261327/* CodeObjectCache.proto */1328typedef struct {1329PyCodeObject* code_object;1330int code_line;1331} __Pyx_CodeObjectCacheEntry;1332struct __Pyx_CodeObjectCache {1333int count;1334int max_count;1335__Pyx_CodeObjectCacheEntry* entries;1336};1337static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};1338static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);1339static PyCodeObject *__pyx_find_code_object(int code_line);1340static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);13411342/* AddTraceback.proto */1343static void __Pyx_AddTraceback(const char *funcname, int c_line,1344int py_line, const char *filename);13451346/* GCCDiagnostics.proto */1347#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))1348#define __Pyx_HAS_GCC_DIAGNOSTIC1349#endif13501351/* CIntToPy.proto */1352static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);13531354/* CIntFromPy.proto */1355static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);13561357/* CIntFromPy.proto */1358static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);13591360/* CIntFromPy.proto */1361static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);13621363/* CIntToPy.proto */1364static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);13651366/* CIntToPy.proto */1367static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);13681369/* FastTypeChecks.proto */1370#if CYTHON_COMPILING_IN_CPYTHON1371#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)1372static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);1373static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);1374static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);1375#else1376#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)1377#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)1378#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))1379#endif1380#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)13811382/* CheckBinaryVersion.proto */1383static int __Pyx_check_binary_version(void);13841385/* FunctionImport.proto */1386static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);13871388/* InitStrings.proto */1389static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);139013911392/* Module declarations from 'nt' */1393static int (*__pyx_f_2nt_gcd)(int, int, int __pyx_skip_dispatch); /*proto*/1394static int (*__pyx_f_2nt_xgcd_c)(int, int, int *, int *); /*proto*/1395static int (*__pyx_f_2nt_inverse_mod)(int, int, int __pyx_skip_dispatch); /*proto*/13961397/* Module declarations from 'numbers' */1398static PyTypeObject *__pyx_ptype_7numbers_A = 0;1399static PyObject *__pyx_f_7numbers___pyx_unpickle_A__set_state(struct __pyx_obj_7numbers_A *, PyObject *); /*proto*/1400#define __Pyx_MODULE_NAME "numbers"1401extern int __pyx_module_is_main_numbers;1402int __pyx_module_is_main_numbers = 0;14031404/* Implementation of 'numbers' */1405static PyObject *__pyx_builtin_range;1406static PyObject *__pyx_builtin_sum;1407static PyObject *__pyx_builtin_reversed;1408static const char __pyx_k_A[] = "A";1409static const char __pyx_k_a[] = "a";1410static const char __pyx_k_b[] = "b";1411static const char __pyx_k_c[] = "c";1412static const char __pyx_k_i[] = "i";1413static const char __pyx_k_n[] = "n";1414static const char __pyx_k_s[] = "s";1415static const char __pyx_k_cx[] = "cx";1416static const char __pyx_k_cy[] = "cy";1417static const char __pyx_k_nt[] = "nt";1418static const char __pyx_k_pi[] = "pi";1419static const char __pyx_k_all[] = "all";1420static const char __pyx_k_gcd[] = "gcd";1421static const char __pyx_k_new[] = "__new__";1422static const char __pyx_k_sum[] = "sum";1423static const char __pyx_k_dict[] = "__dict__";1424static const char __pyx_k_main[] = "__main__";1425static const char __pyx_k_name[] = "__name__";1426static const char __pyx_k_test[] = "__test__";1427static const char __pyx_k_xgcd[] = "xgcd";1428static const char __pyx_k_bench[] = "bench";1429static const char __pyx_k_range[] = "range";1430static const char __pyx_k_value[] = "value";1431static const char __pyx_k_import[] = "__import__";1432static const char __pyx_k_pickle[] = "pickle";1433static const char __pyx_k_reduce[] = "__reduce__";1434static const char __pyx_k_update[] = "update";1435static const char __pyx_k_numbers[] = "numbers";1436static const char __pyx_k_pi_10_5[] = "pi(10**5)";1437static const char __pyx_k_test_pi[] = "test_pi";1438static const char __pyx_k_getstate[] = "__getstate__";1439static const char __pyx_k_pyx_type[] = "__pyx_type";1440static const char __pyx_k_register[] = "register";1441static const char __pyx_k_reversed[] = "reversed";1442static const char __pyx_k_setstate[] = "__setstate__";1443static const char __pyx_k_sum_loop[] = "sum_loop";1444static const char __pyx_k_bench_gcd[] = "bench_gcd";1445static const char __pyx_k_pyx_state[] = "__pyx_state";1446static const char __pyx_k_reduce_ex[] = "__reduce_ex__";1447static const char __pyx_k_sum_range[] = "sum_range";1448static const char __pyx_k_bench_xgcd[] = "bench_xgcd";1449static const char __pyx_k_pyx_result[] = "__pyx_result";1450static const char __pyx_k_PickleError[] = "PickleError";1451static const char __pyx_k_numbers_pyx[] = "numbers.pyx";1452static const char __pyx_k_operator_add[] = "operator_add";1453static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";1454static const char __pyx_k_stringsource[] = "stringsource";1455static const char __pyx_k_sum_reversed[] = "sum_reversed";1456static const char __pyx_k_bench_xgcd_py[] = "bench_xgcd_py";1457static const char __pyx_k_reduce_cython[] = "__reduce_cython__";1458static const char __pyx_k_pyx_unpickle_A[] = "__pyx_unpickle_A";1459static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";1460static const char __pyx_k_setstate_cython[] = "__setstate_cython__";1461static const char __pyx_k_bench_inverse_mod[] = "bench_inverse_mod";1462static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";1463static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))";1464static PyObject *__pyx_n_s_A;1465static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;1466static PyObject *__pyx_n_s_PickleError;1467static PyObject *__pyx_n_s_a;1468static PyObject *__pyx_n_s_all;1469static PyObject *__pyx_n_s_b;1470static PyObject *__pyx_n_s_bench;1471static PyObject *__pyx_n_s_bench_gcd;1472static PyObject *__pyx_n_s_bench_inverse_mod;1473static PyObject *__pyx_n_s_bench_xgcd;1474static PyObject *__pyx_n_s_bench_xgcd_py;1475static PyObject *__pyx_n_s_c;1476static PyObject *__pyx_n_s_cline_in_traceback;1477static PyObject *__pyx_n_s_cx;1478static PyObject *__pyx_n_s_cy;1479static PyObject *__pyx_n_s_dict;1480static PyObject *__pyx_n_s_gcd;1481static PyObject *__pyx_n_s_getstate;1482static PyObject *__pyx_n_s_i;1483static PyObject *__pyx_n_s_import;1484static PyObject *__pyx_n_s_main;1485static PyObject *__pyx_n_s_n;1486static PyObject *__pyx_n_s_name;1487static PyObject *__pyx_n_s_new;1488static PyObject *__pyx_n_s_nt;1489static PyObject *__pyx_n_s_numbers;1490static PyObject *__pyx_kp_s_numbers_pyx;1491static PyObject *__pyx_n_s_operator_add;1492static PyObject *__pyx_n_s_pi;1493static PyObject *__pyx_kp_s_pi_10_5;1494static PyObject *__pyx_n_s_pickle;1495static PyObject *__pyx_n_s_pyx_PickleError;1496static PyObject *__pyx_n_s_pyx_checksum;1497static PyObject *__pyx_n_s_pyx_result;1498static PyObject *__pyx_n_s_pyx_state;1499static PyObject *__pyx_n_s_pyx_type;1500static PyObject *__pyx_n_s_pyx_unpickle_A;1501static PyObject *__pyx_n_s_range;1502static PyObject *__pyx_n_s_reduce;1503static PyObject *__pyx_n_s_reduce_cython;1504static PyObject *__pyx_n_s_reduce_ex;1505static PyObject *__pyx_n_s_register;1506static PyObject *__pyx_n_s_reversed;1507static PyObject *__pyx_n_s_s;1508static PyObject *__pyx_n_s_setstate;1509static PyObject *__pyx_n_s_setstate_cython;1510static PyObject *__pyx_kp_s_stringsource;1511static PyObject *__pyx_n_s_sum;1512static PyObject *__pyx_n_s_sum_loop;1513static PyObject *__pyx_n_s_sum_range;1514static PyObject *__pyx_n_s_sum_reversed;1515static PyObject *__pyx_n_s_test;1516static PyObject *__pyx_n_s_test_pi;1517static PyObject *__pyx_n_s_update;1518static PyObject *__pyx_n_s_value;1519static PyObject *__pyx_n_s_xgcd;1520static PyObject *__pyx_pf_7numbers_test_pi(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */1521static int __pyx_pf_7numbers_1A___init__(struct __pyx_obj_7numbers_A *__pyx_v_self, int __pyx_v_i); /* proto */1522static PyObject *__pyx_pf_7numbers_1A_2value(struct __pyx_obj_7numbers_A *__pyx_v_self); /* proto */1523static PyObject *__pyx_pf_7numbers_1A_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_right); /* proto */1524static PyObject *__pyx_pf_7numbers_1A_6__reduce_cython__(struct __pyx_obj_7numbers_A *__pyx_v_self); /* proto */1525static PyObject *__pyx_pf_7numbers_1A_8__setstate_cython__(struct __pyx_obj_7numbers_A *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */1526static PyObject *__pyx_pf_7numbers_2operator_add(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n); /* proto */1527static PyObject *__pyx_pf_7numbers_4bench_gcd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n); /* proto */1528static PyObject *__pyx_pf_7numbers_6bench_xgcd_py(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n); /* proto */1529static PyObject *__pyx_pf_7numbers_8bench_xgcd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n); /* proto */1530static PyObject *__pyx_pf_7numbers_10bench_inverse_mod(CYTHON_UNUSED PyObject *__pyx_self, PY_LONG_LONG __pyx_v_n); /* proto */1531static PyObject *__pyx_pf_7numbers_12sum_loop(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n); /* proto */1532static PyObject *__pyx_pf_7numbers_14sum_range(CYTHON_UNUSED PyObject *__pyx_self, PY_LONG_LONG __pyx_v_n); /* proto */1533static PyObject *__pyx_pf_7numbers_16sum_reversed(CYTHON_UNUSED PyObject *__pyx_self, PY_LONG_LONG __pyx_v_n); /* proto */1534static PyObject *__pyx_pf_7numbers_18__pyx_unpickle_A(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */1535static PyObject *__pyx_tp_new_7numbers_A(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/1536static PyObject *__pyx_int_0;1537static PyObject *__pyx_int_2;1538static PyObject *__pyx_int_3;1539static PyObject *__pyx_int_5;1540static PyObject *__pyx_int_9592;1541static PyObject *__pyx_int_92250;1542static PyObject *__pyx_int_100000;1543static PyObject *__pyx_int_922350;1544static PyObject *__pyx_int_2414484;1545static PyObject *__pyx_int_4381765;1546static PyObject *__pyx_int_140886208;1547static PyObject *__pyx_int_233296311;1548static PyObject *__pyx_int_166666833333;1549static PyObject *__pyx_int_53532319533988;1550static PyObject *__pyx_tuple_;1551static PyObject *__pyx_tuple__2;1552static PyObject *__pyx_tuple__3;1553static PyObject *__pyx_tuple__4;1554static PyObject *__pyx_tuple__6;1555static PyObject *__pyx_tuple__8;1556static PyObject *__pyx_tuple__10;1557static PyObject *__pyx_tuple__12;1558static PyObject *__pyx_tuple__14;1559static PyObject *__pyx_tuple__16;1560static PyObject *__pyx_tuple__18;1561static PyObject *__pyx_tuple__20;1562static PyObject *__pyx_tuple__22;1563static PyObject *__pyx_tuple__23;1564static PyObject *__pyx_codeobj__5;1565static PyObject *__pyx_codeobj__7;1566static PyObject *__pyx_codeobj__9;1567static PyObject *__pyx_codeobj__11;1568static PyObject *__pyx_codeobj__13;1569static PyObject *__pyx_codeobj__15;1570static PyObject *__pyx_codeobj__17;1571static PyObject *__pyx_codeobj__19;1572static PyObject *__pyx_codeobj__21;1573static PyObject *__pyx_codeobj__24;1574/* Late includes */15751576/* "numbers.pyx":61577* from nt cimport gcd, xgcd_c, inverse_mod1578*1579* def test_pi(n=100000): # <<<<<<<<<<<<<<1580* assert pi(n) == 95921581*1582*/15831584/* Python wrapper */1585static PyObject *__pyx_pw_7numbers_1test_pi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/1586static PyMethodDef __pyx_mdef_7numbers_1test_pi = {"test_pi", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_1test_pi, METH_VARARGS|METH_KEYWORDS, 0};1587static PyObject *__pyx_pw_7numbers_1test_pi(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {1588PyObject *__pyx_v_n = 0;1589int __pyx_lineno = 0;1590const char *__pyx_filename = NULL;1591int __pyx_clineno = 0;1592PyObject *__pyx_r = 0;1593__Pyx_RefNannyDeclarations1594__Pyx_RefNannySetupContext("test_pi (wrapper)", 0);1595{1596static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};1597PyObject* values[1] = {0};1598values[0] = ((PyObject *)__pyx_int_100000);1599if (unlikely(__pyx_kwds)) {1600Py_ssize_t kw_args;1601const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);1602switch (pos_args) {1603case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);1604CYTHON_FALLTHROUGH;1605case 0: break;1606default: goto __pyx_L5_argtuple_error;1607}1608kw_args = PyDict_Size(__pyx_kwds);1609switch (pos_args) {1610case 0:1611if (kw_args > 0) {1612PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);1613if (value) { values[0] = value; kw_args--; }1614}1615}1616if (unlikely(kw_args > 0)) {1617if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test_pi") < 0)) __PYX_ERR(0, 6, __pyx_L3_error)1618}1619} else {1620switch (PyTuple_GET_SIZE(__pyx_args)) {1621case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);1622CYTHON_FALLTHROUGH;1623case 0: break;1624default: goto __pyx_L5_argtuple_error;1625}1626}1627__pyx_v_n = values[0];1628}1629goto __pyx_L4_argument_unpacking_done;1630__pyx_L5_argtuple_error:;1631__Pyx_RaiseArgtupleInvalid("test_pi", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6, __pyx_L3_error)1632__pyx_L3_error:;1633__Pyx_AddTraceback("numbers.test_pi", __pyx_clineno, __pyx_lineno, __pyx_filename);1634__Pyx_RefNannyFinishContext();1635return NULL;1636__pyx_L4_argument_unpacking_done:;1637__pyx_r = __pyx_pf_7numbers_test_pi(__pyx_self, __pyx_v_n);16381639/* function exit code */1640__Pyx_RefNannyFinishContext();1641return __pyx_r;1642}16431644static PyObject *__pyx_pf_7numbers_test_pi(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) {1645PyObject *__pyx_r = NULL;1646__Pyx_RefNannyDeclarations1647PyObject *__pyx_t_1 = NULL;1648PyObject *__pyx_t_2 = NULL;1649PyObject *__pyx_t_3 = NULL;1650int __pyx_t_4;1651int __pyx_lineno = 0;1652const char *__pyx_filename = NULL;1653int __pyx_clineno = 0;1654__Pyx_RefNannySetupContext("test_pi", 0);16551656/* "numbers.pyx":71657*1658* def test_pi(n=100000):1659* assert pi(n) == 9592 # <<<<<<<<<<<<<<1660*1661*1662*/1663#ifndef CYTHON_WITHOUT_ASSERTIONS1664if (unlikely(!Py_OptimizeFlag)) {1665__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)1666__Pyx_GOTREF(__pyx_t_2);1667__pyx_t_3 = NULL;1668if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {1669__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);1670if (likely(__pyx_t_3)) {1671PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);1672__Pyx_INCREF(__pyx_t_3);1673__Pyx_INCREF(function);1674__Pyx_DECREF_SET(__pyx_t_2, function);1675}1676}1677__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_n) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_n);1678__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;1679if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)1680__Pyx_GOTREF(__pyx_t_1);1681__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;1682__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_9592, 0x2578, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)1683__Pyx_GOTREF(__pyx_t_2);1684__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;1685__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 7, __pyx_L1_error)1686__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;1687if (unlikely(!__pyx_t_4)) {1688PyErr_SetNone(PyExc_AssertionError);1689__PYX_ERR(0, 7, __pyx_L1_error)1690}1691}1692#endif16931694/* "numbers.pyx":61695* from nt cimport gcd, xgcd_c, inverse_mod1696*1697* def test_pi(n=100000): # <<<<<<<<<<<<<<1698* assert pi(n) == 95921699*1700*/17011702/* function exit code */1703__pyx_r = Py_None; __Pyx_INCREF(Py_None);1704goto __pyx_L0;1705__pyx_L1_error:;1706__Pyx_XDECREF(__pyx_t_1);1707__Pyx_XDECREF(__pyx_t_2);1708__Pyx_XDECREF(__pyx_t_3);1709__Pyx_AddTraceback("numbers.test_pi", __pyx_clineno, __pyx_lineno, __pyx_filename);1710__pyx_r = NULL;1711__pyx_L0:;1712__Pyx_XGIVEREF(__pyx_r);1713__Pyx_RefNannyFinishContext();1714return __pyx_r;1715}17161717/* "numbers.pyx":141718* cdef class A:1719* cdef int i1720* def __init__(self, int i): # <<<<<<<<<<<<<<1721* self.i = i1722*1723*/17241725/* Python wrapper */1726static int __pyx_pw_7numbers_1A_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/1727static int __pyx_pw_7numbers_1A_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {1728int __pyx_v_i;1729int __pyx_lineno = 0;1730const char *__pyx_filename = NULL;1731int __pyx_clineno = 0;1732int __pyx_r;1733__Pyx_RefNannyDeclarations1734__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);1735{1736static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,0};1737PyObject* values[1] = {0};1738if (unlikely(__pyx_kwds)) {1739Py_ssize_t kw_args;1740const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);1741switch (pos_args) {1742case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);1743CYTHON_FALLTHROUGH;1744case 0: break;1745default: goto __pyx_L5_argtuple_error;1746}1747kw_args = PyDict_Size(__pyx_kwds);1748switch (pos_args) {1749case 0:1750if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;1751else goto __pyx_L5_argtuple_error;1752}1753if (unlikely(kw_args > 0)) {1754if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 14, __pyx_L3_error)1755}1756} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {1757goto __pyx_L5_argtuple_error;1758} else {1759values[0] = PyTuple_GET_ITEM(__pyx_args, 0);1760}1761__pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)1762}1763goto __pyx_L4_argument_unpacking_done;1764__pyx_L5_argtuple_error:;1765__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 14, __pyx_L3_error)1766__pyx_L3_error:;1767__Pyx_AddTraceback("numbers.A.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);1768__Pyx_RefNannyFinishContext();1769return -1;1770__pyx_L4_argument_unpacking_done:;1771__pyx_r = __pyx_pf_7numbers_1A___init__(((struct __pyx_obj_7numbers_A *)__pyx_v_self), __pyx_v_i);17721773/* function exit code */1774__Pyx_RefNannyFinishContext();1775return __pyx_r;1776}17771778static int __pyx_pf_7numbers_1A___init__(struct __pyx_obj_7numbers_A *__pyx_v_self, int __pyx_v_i) {1779int __pyx_r;1780__Pyx_RefNannyDeclarations1781__Pyx_RefNannySetupContext("__init__", 0);17821783/* "numbers.pyx":151784* cdef int i1785* def __init__(self, int i):1786* self.i = i # <<<<<<<<<<<<<<1787*1788* def value(self):1789*/1790__pyx_v_self->i = __pyx_v_i;17911792/* "numbers.pyx":141793* cdef class A:1794* cdef int i1795* def __init__(self, int i): # <<<<<<<<<<<<<<1796* self.i = i1797*1798*/17991800/* function exit code */1801__pyx_r = 0;1802__Pyx_RefNannyFinishContext();1803return __pyx_r;1804}18051806/* "numbers.pyx":171807* self.i = i1808*1809* def value(self): # <<<<<<<<<<<<<<1810* return self.i1811*1812*/18131814/* Python wrapper */1815static PyObject *__pyx_pw_7numbers_1A_3value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/1816static PyObject *__pyx_pw_7numbers_1A_3value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {1817PyObject *__pyx_r = 0;1818__Pyx_RefNannyDeclarations1819__Pyx_RefNannySetupContext("value (wrapper)", 0);1820__pyx_r = __pyx_pf_7numbers_1A_2value(((struct __pyx_obj_7numbers_A *)__pyx_v_self));18211822/* function exit code */1823__Pyx_RefNannyFinishContext();1824return __pyx_r;1825}18261827static PyObject *__pyx_pf_7numbers_1A_2value(struct __pyx_obj_7numbers_A *__pyx_v_self) {1828PyObject *__pyx_r = NULL;1829__Pyx_RefNannyDeclarations1830PyObject *__pyx_t_1 = NULL;1831int __pyx_lineno = 0;1832const char *__pyx_filename = NULL;1833int __pyx_clineno = 0;1834__Pyx_RefNannySetupContext("value", 0);18351836/* "numbers.pyx":181837*1838* def value(self):1839* return self.i # <<<<<<<<<<<<<<1840*1841* def __add__(self, right):1842*/1843__Pyx_XDECREF(__pyx_r);1844__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)1845__Pyx_GOTREF(__pyx_t_1);1846__pyx_r = __pyx_t_1;1847__pyx_t_1 = 0;1848goto __pyx_L0;18491850/* "numbers.pyx":171851* self.i = i1852*1853* def value(self): # <<<<<<<<<<<<<<1854* return self.i1855*1856*/18571858/* function exit code */1859__pyx_L1_error:;1860__Pyx_XDECREF(__pyx_t_1);1861__Pyx_AddTraceback("numbers.A.value", __pyx_clineno, __pyx_lineno, __pyx_filename);1862__pyx_r = NULL;1863__pyx_L0:;1864__Pyx_XGIVEREF(__pyx_r);1865__Pyx_RefNannyFinishContext();1866return __pyx_r;1867}18681869/* "numbers.pyx":201870* return self.i1871*1872* def __add__(self, right): # <<<<<<<<<<<<<<1873* return A((<A>self).i + (<A>right).i)1874*1875*/18761877/* Python wrapper */1878static PyObject *__pyx_pw_7numbers_1A_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_right); /*proto*/1879static PyObject *__pyx_pw_7numbers_1A_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_right) {1880PyObject *__pyx_r = 0;1881__Pyx_RefNannyDeclarations1882__Pyx_RefNannySetupContext("__add__ (wrapper)", 0);1883__pyx_r = __pyx_pf_7numbers_1A_4__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_right));18841885/* function exit code */1886__Pyx_RefNannyFinishContext();1887return __pyx_r;1888}18891890static PyObject *__pyx_pf_7numbers_1A_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_right) {1891PyObject *__pyx_r = NULL;1892__Pyx_RefNannyDeclarations1893PyObject *__pyx_t_1 = NULL;1894PyObject *__pyx_t_2 = NULL;1895int __pyx_lineno = 0;1896const char *__pyx_filename = NULL;1897int __pyx_clineno = 0;1898__Pyx_RefNannySetupContext("__add__", 0);18991900/* "numbers.pyx":211901*1902* def __add__(self, right):1903* return A((<A>self).i + (<A>right).i) # <<<<<<<<<<<<<<1904*1905* def operator_add(int n=100000):1906*/1907__Pyx_XDECREF(__pyx_r);1908__pyx_t_1 = __Pyx_PyInt_From_int((((struct __pyx_obj_7numbers_A *)__pyx_v_self)->i + ((struct __pyx_obj_7numbers_A *)__pyx_v_right)->i)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)1909__Pyx_GOTREF(__pyx_t_1);1910__pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7numbers_A), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)1911__Pyx_GOTREF(__pyx_t_2);1912__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;1913__pyx_r = __pyx_t_2;1914__pyx_t_2 = 0;1915goto __pyx_L0;19161917/* "numbers.pyx":201918* return self.i1919*1920* def __add__(self, right): # <<<<<<<<<<<<<<1921* return A((<A>self).i + (<A>right).i)1922*1923*/19241925/* function exit code */1926__pyx_L1_error:;1927__Pyx_XDECREF(__pyx_t_1);1928__Pyx_XDECREF(__pyx_t_2);1929__Pyx_AddTraceback("numbers.A.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);1930__pyx_r = NULL;1931__pyx_L0:;1932__Pyx_XGIVEREF(__pyx_r);1933__Pyx_RefNannyFinishContext();1934return __pyx_r;1935}19361937/* "(tree fragment)":11938* def __reduce_cython__(self): # <<<<<<<<<<<<<<1939* cdef tuple state1940* cdef object _dict1941*/19421943/* Python wrapper */1944static PyObject *__pyx_pw_7numbers_1A_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/1945static PyObject *__pyx_pw_7numbers_1A_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {1946PyObject *__pyx_r = 0;1947__Pyx_RefNannyDeclarations1948__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);1949__pyx_r = __pyx_pf_7numbers_1A_6__reduce_cython__(((struct __pyx_obj_7numbers_A *)__pyx_v_self));19501951/* function exit code */1952__Pyx_RefNannyFinishContext();1953return __pyx_r;1954}19551956static PyObject *__pyx_pf_7numbers_1A_6__reduce_cython__(struct __pyx_obj_7numbers_A *__pyx_v_self) {1957PyObject *__pyx_v_state = 0;1958PyObject *__pyx_v__dict = 0;1959int __pyx_v_use_setstate;1960PyObject *__pyx_r = NULL;1961__Pyx_RefNannyDeclarations1962PyObject *__pyx_t_1 = NULL;1963PyObject *__pyx_t_2 = NULL;1964int __pyx_t_3;1965int __pyx_t_4;1966PyObject *__pyx_t_5 = NULL;1967int __pyx_lineno = 0;1968const char *__pyx_filename = NULL;1969int __pyx_clineno = 0;1970__Pyx_RefNannySetupContext("__reduce_cython__", 0);19711972/* "(tree fragment)":51973* cdef object _dict1974* cdef bint use_setstate1975* state = (self.i,) # <<<<<<<<<<<<<<1976* _dict = getattr(self, '__dict__', None)1977* if _dict is not None:1978*/1979__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)1980__Pyx_GOTREF(__pyx_t_1);1981__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)1982__Pyx_GOTREF(__pyx_t_2);1983__Pyx_GIVEREF(__pyx_t_1);1984PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);1985__pyx_t_1 = 0;1986__pyx_v_state = ((PyObject*)__pyx_t_2);1987__pyx_t_2 = 0;19881989/* "(tree fragment)":61990* cdef bint use_setstate1991* state = (self.i,)1992* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<1993* if _dict is not None:1994* state += (_dict,)1995*/1996__pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)1997__Pyx_GOTREF(__pyx_t_2);1998__pyx_v__dict = __pyx_t_2;1999__pyx_t_2 = 0;20002001/* "(tree fragment)":72002* state = (self.i,)2003* _dict = getattr(self, '__dict__', None)2004* if _dict is not None: # <<<<<<<<<<<<<<2005* state += (_dict,)2006* use_setstate = True2007*/2008__pyx_t_3 = (__pyx_v__dict != Py_None);2009__pyx_t_4 = (__pyx_t_3 != 0);2010if (__pyx_t_4) {20112012/* "(tree fragment)":82013* _dict = getattr(self, '__dict__', None)2014* if _dict is not None:2015* state += (_dict,) # <<<<<<<<<<<<<<2016* use_setstate = True2017* else:2018*/2019__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)2020__Pyx_GOTREF(__pyx_t_2);2021__Pyx_INCREF(__pyx_v__dict);2022__Pyx_GIVEREF(__pyx_v__dict);2023PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict);2024__pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)2025__Pyx_GOTREF(__pyx_t_1);2026__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;2027__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1));2028__pyx_t_1 = 0;20292030/* "(tree fragment)":92031* if _dict is not None:2032* state += (_dict,)2033* use_setstate = True # <<<<<<<<<<<<<<2034* else:2035* use_setstate = False2036*/2037__pyx_v_use_setstate = 1;20382039/* "(tree fragment)":72040* state = (self.i,)2041* _dict = getattr(self, '__dict__', None)2042* if _dict is not None: # <<<<<<<<<<<<<<2043* state += (_dict,)2044* use_setstate = True2045*/2046goto __pyx_L3;2047}20482049/* "(tree fragment)":112050* use_setstate = True2051* else:2052* use_setstate = False # <<<<<<<<<<<<<<2053* if use_setstate:2054* return __pyx_unpickle_A, (type(self), 0x865c0c0, None), state2055*/2056/*else*/ {2057__pyx_v_use_setstate = 0;2058}2059__pyx_L3:;20602061/* "(tree fragment)":122062* else:2063* use_setstate = False2064* if use_setstate: # <<<<<<<<<<<<<<2065* return __pyx_unpickle_A, (type(self), 0x865c0c0, None), state2066* else:2067*/2068__pyx_t_4 = (__pyx_v_use_setstate != 0);2069if (__pyx_t_4) {20702071/* "(tree fragment)":132072* use_setstate = False2073* if use_setstate:2074* return __pyx_unpickle_A, (type(self), 0x865c0c0, None), state # <<<<<<<<<<<<<<2075* else:2076* return __pyx_unpickle_A, (type(self), 0x865c0c0, state)2077*/2078__Pyx_XDECREF(__pyx_r);2079__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_A); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)2080__Pyx_GOTREF(__pyx_t_1);2081__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)2082__Pyx_GOTREF(__pyx_t_2);2083__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));2084__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));2085PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));2086__Pyx_INCREF(__pyx_int_140886208);2087__Pyx_GIVEREF(__pyx_int_140886208);2088PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_140886208);2089__Pyx_INCREF(Py_None);2090__Pyx_GIVEREF(Py_None);2091PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);2092__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)2093__Pyx_GOTREF(__pyx_t_5);2094__Pyx_GIVEREF(__pyx_t_1);2095PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);2096__Pyx_GIVEREF(__pyx_t_2);2097PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);2098__Pyx_INCREF(__pyx_v_state);2099__Pyx_GIVEREF(__pyx_v_state);2100PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);2101__pyx_t_1 = 0;2102__pyx_t_2 = 0;2103__pyx_r = __pyx_t_5;2104__pyx_t_5 = 0;2105goto __pyx_L0;21062107/* "(tree fragment)":122108* else:2109* use_setstate = False2110* if use_setstate: # <<<<<<<<<<<<<<2111* return __pyx_unpickle_A, (type(self), 0x865c0c0, None), state2112* else:2113*/2114}21152116/* "(tree fragment)":152117* return __pyx_unpickle_A, (type(self), 0x865c0c0, None), state2118* else:2119* return __pyx_unpickle_A, (type(self), 0x865c0c0, state) # <<<<<<<<<<<<<<2120* def __setstate_cython__(self, __pyx_state):2121* __pyx_unpickle_A__set_state(self, __pyx_state)2122*/2123/*else*/ {2124__Pyx_XDECREF(__pyx_r);2125__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_A); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)2126__Pyx_GOTREF(__pyx_t_5);2127__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)2128__Pyx_GOTREF(__pyx_t_2);2129__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));2130__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));2131PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));2132__Pyx_INCREF(__pyx_int_140886208);2133__Pyx_GIVEREF(__pyx_int_140886208);2134PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_140886208);2135__Pyx_INCREF(__pyx_v_state);2136__Pyx_GIVEREF(__pyx_v_state);2137PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);2138__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)2139__Pyx_GOTREF(__pyx_t_1);2140__Pyx_GIVEREF(__pyx_t_5);2141PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);2142__Pyx_GIVEREF(__pyx_t_2);2143PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);2144__pyx_t_5 = 0;2145__pyx_t_2 = 0;2146__pyx_r = __pyx_t_1;2147__pyx_t_1 = 0;2148goto __pyx_L0;2149}21502151/* "(tree fragment)":12152* def __reduce_cython__(self): # <<<<<<<<<<<<<<2153* cdef tuple state2154* cdef object _dict2155*/21562157/* function exit code */2158__pyx_L1_error:;2159__Pyx_XDECREF(__pyx_t_1);2160__Pyx_XDECREF(__pyx_t_2);2161__Pyx_XDECREF(__pyx_t_5);2162__Pyx_AddTraceback("numbers.A.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);2163__pyx_r = NULL;2164__pyx_L0:;2165__Pyx_XDECREF(__pyx_v_state);2166__Pyx_XDECREF(__pyx_v__dict);2167__Pyx_XGIVEREF(__pyx_r);2168__Pyx_RefNannyFinishContext();2169return __pyx_r;2170}21712172/* "(tree fragment)":162173* else:2174* return __pyx_unpickle_A, (type(self), 0x865c0c0, state)2175* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<2176* __pyx_unpickle_A__set_state(self, __pyx_state)2177*/21782179/* Python wrapper */2180static PyObject *__pyx_pw_7numbers_1A_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/2181static PyObject *__pyx_pw_7numbers_1A_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {2182PyObject *__pyx_r = 0;2183__Pyx_RefNannyDeclarations2184__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);2185__pyx_r = __pyx_pf_7numbers_1A_8__setstate_cython__(((struct __pyx_obj_7numbers_A *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));21862187/* function exit code */2188__Pyx_RefNannyFinishContext();2189return __pyx_r;2190}21912192static PyObject *__pyx_pf_7numbers_1A_8__setstate_cython__(struct __pyx_obj_7numbers_A *__pyx_v_self, PyObject *__pyx_v___pyx_state) {2193PyObject *__pyx_r = NULL;2194__Pyx_RefNannyDeclarations2195PyObject *__pyx_t_1 = NULL;2196int __pyx_lineno = 0;2197const char *__pyx_filename = NULL;2198int __pyx_clineno = 0;2199__Pyx_RefNannySetupContext("__setstate_cython__", 0);22002201/* "(tree fragment)":172202* return __pyx_unpickle_A, (type(self), 0x865c0c0, state)2203* def __setstate_cython__(self, __pyx_state):2204* __pyx_unpickle_A__set_state(self, __pyx_state) # <<<<<<<<<<<<<<2205*/2206if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)2207__pyx_t_1 = __pyx_f_7numbers___pyx_unpickle_A__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)2208__Pyx_GOTREF(__pyx_t_1);2209__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;22102211/* "(tree fragment)":162212* else:2213* return __pyx_unpickle_A, (type(self), 0x865c0c0, state)2214* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<2215* __pyx_unpickle_A__set_state(self, __pyx_state)2216*/22172218/* function exit code */2219__pyx_r = Py_None; __Pyx_INCREF(Py_None);2220goto __pyx_L0;2221__pyx_L1_error:;2222__Pyx_XDECREF(__pyx_t_1);2223__Pyx_AddTraceback("numbers.A.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);2224__pyx_r = NULL;2225__pyx_L0:;2226__Pyx_XGIVEREF(__pyx_r);2227__Pyx_RefNannyFinishContext();2228return __pyx_r;2229}22302231/* "numbers.pyx":232232* return A((<A>self).i + (<A>right).i)2233*2234* def operator_add(int n=100000): # <<<<<<<<<<<<<<2235*2236* a = A(2)2237*/22382239/* Python wrapper */2240static PyObject *__pyx_pw_7numbers_3operator_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/2241static PyMethodDef __pyx_mdef_7numbers_3operator_add = {"operator_add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_3operator_add, METH_VARARGS|METH_KEYWORDS, 0};2242static PyObject *__pyx_pw_7numbers_3operator_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {2243int __pyx_v_n;2244int __pyx_lineno = 0;2245const char *__pyx_filename = NULL;2246int __pyx_clineno = 0;2247PyObject *__pyx_r = 0;2248__Pyx_RefNannyDeclarations2249__Pyx_RefNannySetupContext("operator_add (wrapper)", 0);2250{2251static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};2252PyObject* values[1] = {0};2253if (unlikely(__pyx_kwds)) {2254Py_ssize_t kw_args;2255const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);2256switch (pos_args) {2257case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2258CYTHON_FALLTHROUGH;2259case 0: break;2260default: goto __pyx_L5_argtuple_error;2261}2262kw_args = PyDict_Size(__pyx_kwds);2263switch (pos_args) {2264case 0:2265if (kw_args > 0) {2266PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);2267if (value) { values[0] = value; kw_args--; }2268}2269}2270if (unlikely(kw_args > 0)) {2271if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "operator_add") < 0)) __PYX_ERR(0, 23, __pyx_L3_error)2272}2273} else {2274switch (PyTuple_GET_SIZE(__pyx_args)) {2275case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2276CYTHON_FALLTHROUGH;2277case 0: break;2278default: goto __pyx_L5_argtuple_error;2279}2280}2281if (values[0]) {2282__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error)2283} else {2284__pyx_v_n = ((int)0x186A0);2285}2286}2287goto __pyx_L4_argument_unpacking_done;2288__pyx_L5_argtuple_error:;2289__Pyx_RaiseArgtupleInvalid("operator_add", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 23, __pyx_L3_error)2290__pyx_L3_error:;2291__Pyx_AddTraceback("numbers.operator_add", __pyx_clineno, __pyx_lineno, __pyx_filename);2292__Pyx_RefNannyFinishContext();2293return NULL;2294__pyx_L4_argument_unpacking_done:;2295__pyx_r = __pyx_pf_7numbers_2operator_add(__pyx_self, __pyx_v_n);22962297/* function exit code */2298__Pyx_RefNannyFinishContext();2299return __pyx_r;2300}23012302static PyObject *__pyx_pf_7numbers_2operator_add(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n) {2303struct __pyx_obj_7numbers_A *__pyx_v_a = NULL;2304struct __pyx_obj_7numbers_A *__pyx_v_b = NULL;2305CYTHON_UNUSED int __pyx_v_i;2306PyObject *__pyx_v_c = NULL;2307PyObject *__pyx_r = NULL;2308__Pyx_RefNannyDeclarations2309PyObject *__pyx_t_1 = NULL;2310int __pyx_t_2;2311int __pyx_t_3;2312int __pyx_t_4;2313PyObject *__pyx_t_5 = NULL;2314PyObject *__pyx_t_6 = NULL;2315int __pyx_t_7;2316int __pyx_lineno = 0;2317const char *__pyx_filename = NULL;2318int __pyx_clineno = 0;2319__Pyx_RefNannySetupContext("operator_add", 0);23202321/* "numbers.pyx":252322* def operator_add(int n=100000):2323*2324* a = A(2) # <<<<<<<<<<<<<<2325* b = A(3)2326* cdef int i2327*/2328__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7numbers_A), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)2329__Pyx_GOTREF(__pyx_t_1);2330__pyx_v_a = ((struct __pyx_obj_7numbers_A *)__pyx_t_1);2331__pyx_t_1 = 0;23322333/* "numbers.pyx":262334*2335* a = A(2)2336* b = A(3) # <<<<<<<<<<<<<<2337* cdef int i2338* for i in range(n):2339*/2340__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7numbers_A), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)2341__Pyx_GOTREF(__pyx_t_1);2342__pyx_v_b = ((struct __pyx_obj_7numbers_A *)__pyx_t_1);2343__pyx_t_1 = 0;23442345/* "numbers.pyx":282346* b = A(3)2347* cdef int i2348* for i in range(n): # <<<<<<<<<<<<<<2349* c = a + b2350* assert c.value() == 52351*/2352__pyx_t_2 = __pyx_v_n;2353__pyx_t_3 = __pyx_t_2;2354for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {2355__pyx_v_i = __pyx_t_4;23562357/* "numbers.pyx":292358* cdef int i2359* for i in range(n):2360* c = a + b # <<<<<<<<<<<<<<2361* assert c.value() == 52362*2363*/2364__pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)2365__Pyx_GOTREF(__pyx_t_1);2366__Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1);2367__pyx_t_1 = 0;2368}23692370/* "numbers.pyx":302371* for i in range(n):2372* c = a + b2373* assert c.value() == 5 # <<<<<<<<<<<<<<2374*2375*2376*/2377#ifndef CYTHON_WITHOUT_ASSERTIONS2378if (unlikely(!Py_OptimizeFlag)) {2379if (unlikely(!__pyx_v_c)) { __Pyx_RaiseUnboundLocalError("c"); __PYX_ERR(0, 30, __pyx_L1_error) }2380__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)2381__Pyx_GOTREF(__pyx_t_5);2382__pyx_t_6 = NULL;2383if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {2384__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);2385if (likely(__pyx_t_6)) {2386PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);2387__Pyx_INCREF(__pyx_t_6);2388__Pyx_INCREF(function);2389__Pyx_DECREF_SET(__pyx_t_5, function);2390}2391}2392__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);2393__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;2394if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)2395__Pyx_GOTREF(__pyx_t_1);2396__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;2397__pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_5, 5, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)2398__Pyx_GOTREF(__pyx_t_5);2399__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;2400__pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 30, __pyx_L1_error)2401__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;2402if (unlikely(!__pyx_t_7)) {2403PyErr_SetNone(PyExc_AssertionError);2404__PYX_ERR(0, 30, __pyx_L1_error)2405}2406}2407#endif24082409/* "numbers.pyx":232410* return A((<A>self).i + (<A>right).i)2411*2412* def operator_add(int n=100000): # <<<<<<<<<<<<<<2413*2414* a = A(2)2415*/24162417/* function exit code */2418__pyx_r = Py_None; __Pyx_INCREF(Py_None);2419goto __pyx_L0;2420__pyx_L1_error:;2421__Pyx_XDECREF(__pyx_t_1);2422__Pyx_XDECREF(__pyx_t_5);2423__Pyx_XDECREF(__pyx_t_6);2424__Pyx_AddTraceback("numbers.operator_add", __pyx_clineno, __pyx_lineno, __pyx_filename);2425__pyx_r = NULL;2426__pyx_L0:;2427__Pyx_XDECREF((PyObject *)__pyx_v_a);2428__Pyx_XDECREF((PyObject *)__pyx_v_b);2429__Pyx_XDECREF(__pyx_v_c);2430__Pyx_XGIVEREF(__pyx_r);2431__Pyx_RefNannyFinishContext();2432return __pyx_r;2433}24342435/* "numbers.pyx":362436*2437*2438* def bench_gcd(int n=10**5): # <<<<<<<<<<<<<<2439* cdef int s = 02440* cdef int i2441*/24422443/* Python wrapper */2444static PyObject *__pyx_pw_7numbers_5bench_gcd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/2445static PyMethodDef __pyx_mdef_7numbers_5bench_gcd = {"bench_gcd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_5bench_gcd, METH_VARARGS|METH_KEYWORDS, 0};2446static PyObject *__pyx_pw_7numbers_5bench_gcd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {2447int __pyx_v_n;2448int __pyx_lineno = 0;2449const char *__pyx_filename = NULL;2450int __pyx_clineno = 0;2451PyObject *__pyx_r = 0;2452__Pyx_RefNannyDeclarations2453__Pyx_RefNannySetupContext("bench_gcd (wrapper)", 0);2454{2455static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};2456PyObject* values[1] = {0};2457if (unlikely(__pyx_kwds)) {2458Py_ssize_t kw_args;2459const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);2460switch (pos_args) {2461case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2462CYTHON_FALLTHROUGH;2463case 0: break;2464default: goto __pyx_L5_argtuple_error;2465}2466kw_args = PyDict_Size(__pyx_kwds);2467switch (pos_args) {2468case 0:2469if (kw_args > 0) {2470PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);2471if (value) { values[0] = value; kw_args--; }2472}2473}2474if (unlikely(kw_args > 0)) {2475if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bench_gcd") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)2476}2477} else {2478switch (PyTuple_GET_SIZE(__pyx_args)) {2479case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2480CYTHON_FALLTHROUGH;2481case 0: break;2482default: goto __pyx_L5_argtuple_error;2483}2484}2485if (values[0]) {2486__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)2487} else {2488__pyx_v_n = ((int)0x186A0);2489}2490}2491goto __pyx_L4_argument_unpacking_done;2492__pyx_L5_argtuple_error:;2493__Pyx_RaiseArgtupleInvalid("bench_gcd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)2494__pyx_L3_error:;2495__Pyx_AddTraceback("numbers.bench_gcd", __pyx_clineno, __pyx_lineno, __pyx_filename);2496__Pyx_RefNannyFinishContext();2497return NULL;2498__pyx_L4_argument_unpacking_done:;2499__pyx_r = __pyx_pf_7numbers_4bench_gcd(__pyx_self, __pyx_v_n);25002501/* function exit code */2502__Pyx_RefNannyFinishContext();2503return __pyx_r;2504}25052506static PyObject *__pyx_pf_7numbers_4bench_gcd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n) {2507int __pyx_v_s;2508int __pyx_v_i;2509PyObject *__pyx_r = NULL;2510__Pyx_RefNannyDeclarations2511int __pyx_t_1;2512int __pyx_t_2;2513int __pyx_t_3;2514PyObject *__pyx_t_4 = NULL;2515int __pyx_lineno = 0;2516const char *__pyx_filename = NULL;2517int __pyx_clineno = 0;2518__Pyx_RefNannySetupContext("bench_gcd", 0);25192520/* "numbers.pyx":372521*2522* def bench_gcd(int n=10**5):2523* cdef int s = 0 # <<<<<<<<<<<<<<2524* cdef int i2525* for i in range(n):2526*/2527__pyx_v_s = 0;25282529/* "numbers.pyx":392530* cdef int s = 02531* cdef int i2532* for i in range(n): # <<<<<<<<<<<<<<2533* s += gcd(92250, 922350 + i)2534* assert s == 24144842535*/2536__pyx_t_1 = __pyx_v_n;2537__pyx_t_2 = __pyx_t_1;2538for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {2539__pyx_v_i = __pyx_t_3;25402541/* "numbers.pyx":402542* cdef int i2543* for i in range(n):2544* s += gcd(92250, 922350 + i) # <<<<<<<<<<<<<<2545* assert s == 24144842546* return s2547*/2548__pyx_v_s = (__pyx_v_s + __pyx_f_2nt_gcd(0x1685A, (0xE12EE + __pyx_v_i), 0));2549}25502551/* "numbers.pyx":412552* for i in range(n):2553* s += gcd(92250, 922350 + i)2554* assert s == 2414484 # <<<<<<<<<<<<<<2555* return s2556*2557*/2558#ifndef CYTHON_WITHOUT_ASSERTIONS2559if (unlikely(!Py_OptimizeFlag)) {2560if (unlikely(!((__pyx_v_s == 0x24D794) != 0))) {2561PyErr_SetNone(PyExc_AssertionError);2562__PYX_ERR(0, 41, __pyx_L1_error)2563}2564}2565#endif25662567/* "numbers.pyx":422568* s += gcd(92250, 922350 + i)2569* assert s == 24144842570* return s # <<<<<<<<<<<<<<2571*2572*2573*/2574__Pyx_XDECREF(__pyx_r);2575__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error)2576__Pyx_GOTREF(__pyx_t_4);2577__pyx_r = __pyx_t_4;2578__pyx_t_4 = 0;2579goto __pyx_L0;25802581/* "numbers.pyx":362582*2583*2584* def bench_gcd(int n=10**5): # <<<<<<<<<<<<<<2585* cdef int s = 02586* cdef int i2587*/25882589/* function exit code */2590__pyx_L1_error:;2591__Pyx_XDECREF(__pyx_t_4);2592__Pyx_AddTraceback("numbers.bench_gcd", __pyx_clineno, __pyx_lineno, __pyx_filename);2593__pyx_r = NULL;2594__pyx_L0:;2595__Pyx_XGIVEREF(__pyx_r);2596__Pyx_RefNannyFinishContext();2597return __pyx_r;2598}25992600/* "numbers.pyx":482601*2602*2603* def bench_xgcd_py(n=10**5): # <<<<<<<<<<<<<<2604* s = 02605* for i in range(n):2606*/26072608/* Python wrapper */2609static PyObject *__pyx_pw_7numbers_7bench_xgcd_py(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/2610static PyMethodDef __pyx_mdef_7numbers_7bench_xgcd_py = {"bench_xgcd_py", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_7bench_xgcd_py, METH_VARARGS|METH_KEYWORDS, 0};2611static PyObject *__pyx_pw_7numbers_7bench_xgcd_py(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {2612PyObject *__pyx_v_n = 0;2613int __pyx_lineno = 0;2614const char *__pyx_filename = NULL;2615int __pyx_clineno = 0;2616PyObject *__pyx_r = 0;2617__Pyx_RefNannyDeclarations2618__Pyx_RefNannySetupContext("bench_xgcd_py (wrapper)", 0);2619{2620static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};2621PyObject* values[1] = {0};2622values[0] = ((PyObject *)__pyx_int_100000);2623if (unlikely(__pyx_kwds)) {2624Py_ssize_t kw_args;2625const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);2626switch (pos_args) {2627case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2628CYTHON_FALLTHROUGH;2629case 0: break;2630default: goto __pyx_L5_argtuple_error;2631}2632kw_args = PyDict_Size(__pyx_kwds);2633switch (pos_args) {2634case 0:2635if (kw_args > 0) {2636PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);2637if (value) { values[0] = value; kw_args--; }2638}2639}2640if (unlikely(kw_args > 0)) {2641if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bench_xgcd_py") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)2642}2643} else {2644switch (PyTuple_GET_SIZE(__pyx_args)) {2645case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2646CYTHON_FALLTHROUGH;2647case 0: break;2648default: goto __pyx_L5_argtuple_error;2649}2650}2651__pyx_v_n = values[0];2652}2653goto __pyx_L4_argument_unpacking_done;2654__pyx_L5_argtuple_error:;2655__Pyx_RaiseArgtupleInvalid("bench_xgcd_py", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error)2656__pyx_L3_error:;2657__Pyx_AddTraceback("numbers.bench_xgcd_py", __pyx_clineno, __pyx_lineno, __pyx_filename);2658__Pyx_RefNannyFinishContext();2659return NULL;2660__pyx_L4_argument_unpacking_done:;2661__pyx_r = __pyx_pf_7numbers_6bench_xgcd_py(__pyx_self, __pyx_v_n);26622663/* function exit code */2664__Pyx_RefNannyFinishContext();2665return __pyx_r;2666}26672668static PyObject *__pyx_pf_7numbers_6bench_xgcd_py(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) {2669PyObject *__pyx_v_s = NULL;2670PyObject *__pyx_v_i = NULL;2671PyObject *__pyx_r = NULL;2672__Pyx_RefNannyDeclarations2673PyObject *__pyx_t_1 = NULL;2674PyObject *__pyx_t_2 = NULL;2675Py_ssize_t __pyx_t_3;2676PyObject *(*__pyx_t_4)(PyObject *);2677PyObject *__pyx_t_5 = NULL;2678PyObject *__pyx_t_6 = NULL;2679PyObject *__pyx_t_7 = NULL;2680int __pyx_t_8;2681PyObject *__pyx_t_9 = NULL;2682int __pyx_t_10;2683int __pyx_lineno = 0;2684const char *__pyx_filename = NULL;2685int __pyx_clineno = 0;2686__Pyx_RefNannySetupContext("bench_xgcd_py", 0);26872688/* "numbers.pyx":492689*2690* def bench_xgcd_py(n=10**5):2691* s = 0 # <<<<<<<<<<<<<<2692* for i in range(n):2693* s += xgcd(92250, 922350 + i)[0]2694*/2695__Pyx_INCREF(__pyx_int_0);2696__pyx_v_s = __pyx_int_0;26972698/* "numbers.pyx":502699* def bench_xgcd_py(n=10**5):2700* s = 02701* for i in range(n): # <<<<<<<<<<<<<<2702* s += xgcd(92250, 922350 + i)[0]2703* assert s == 24144842704*/2705__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)2706__Pyx_GOTREF(__pyx_t_1);2707if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {2708__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;2709__pyx_t_4 = NULL;2710} else {2711__pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)2712__Pyx_GOTREF(__pyx_t_2);2713__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)2714}2715__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;2716for (;;) {2717if (likely(!__pyx_t_4)) {2718if (likely(PyList_CheckExact(__pyx_t_2))) {2719if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;2720#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS2721__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 50, __pyx_L1_error)2722#else2723__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)2724__Pyx_GOTREF(__pyx_t_1);2725#endif2726} else {2727if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;2728#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS2729__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 50, __pyx_L1_error)2730#else2731__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)2732__Pyx_GOTREF(__pyx_t_1);2733#endif2734}2735} else {2736__pyx_t_1 = __pyx_t_4(__pyx_t_2);2737if (unlikely(!__pyx_t_1)) {2738PyObject* exc_type = PyErr_Occurred();2739if (exc_type) {2740if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();2741else __PYX_ERR(0, 50, __pyx_L1_error)2742}2743break;2744}2745__Pyx_GOTREF(__pyx_t_1);2746}2747__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);2748__pyx_t_1 = 0;27492750/* "numbers.pyx":512751* s = 02752* for i in range(n):2753* s += xgcd(92250, 922350 + i)[0] # <<<<<<<<<<<<<<2754* assert s == 24144842755* return s2756*/2757__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_xgcd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)2758__Pyx_GOTREF(__pyx_t_5);2759__pyx_t_6 = __Pyx_PyInt_AddCObj(__pyx_int_922350, __pyx_v_i, 0xE12EE, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)2760__Pyx_GOTREF(__pyx_t_6);2761__pyx_t_7 = NULL;2762__pyx_t_8 = 0;2763if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {2764__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);2765if (likely(__pyx_t_7)) {2766PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);2767__Pyx_INCREF(__pyx_t_7);2768__Pyx_INCREF(function);2769__Pyx_DECREF_SET(__pyx_t_5, function);2770__pyx_t_8 = 1;2771}2772}2773#if CYTHON_FAST_PYCALL2774if (PyFunction_Check(__pyx_t_5)) {2775PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_int_92250, __pyx_t_6};2776__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)2777__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;2778__Pyx_GOTREF(__pyx_t_1);2779__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;2780} else2781#endif2782#if CYTHON_FAST_PYCCALL2783if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {2784PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_int_92250, __pyx_t_6};2785__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)2786__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;2787__Pyx_GOTREF(__pyx_t_1);2788__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;2789} else2790#endif2791{2792__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L1_error)2793__Pyx_GOTREF(__pyx_t_9);2794if (__pyx_t_7) {2795__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;2796}2797__Pyx_INCREF(__pyx_int_92250);2798__Pyx_GIVEREF(__pyx_int_92250);2799PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_int_92250);2800__Pyx_GIVEREF(__pyx_t_6);2801PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);2802__pyx_t_6 = 0;2803__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)2804__Pyx_GOTREF(__pyx_t_1);2805__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;2806}2807__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;2808__pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)2809__Pyx_GOTREF(__pyx_t_5);2810__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;2811__pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)2812__Pyx_GOTREF(__pyx_t_1);2813__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;2814__Pyx_DECREF_SET(__pyx_v_s, __pyx_t_1);2815__pyx_t_1 = 0;28162817/* "numbers.pyx":502818* def bench_xgcd_py(n=10**5):2819* s = 02820* for i in range(n): # <<<<<<<<<<<<<<2821* s += xgcd(92250, 922350 + i)[0]2822* assert s == 24144842823*/2824}2825__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;28262827/* "numbers.pyx":522828* for i in range(n):2829* s += xgcd(92250, 922350 + i)[0]2830* assert s == 2414484 # <<<<<<<<<<<<<<2831* return s2832*2833*/2834#ifndef CYTHON_WITHOUT_ASSERTIONS2835if (unlikely(!Py_OptimizeFlag)) {2836__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_s, __pyx_int_2414484, 0x24D794, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)2837__Pyx_GOTREF(__pyx_t_2);2838__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 52, __pyx_L1_error)2839__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;2840if (unlikely(!__pyx_t_10)) {2841PyErr_SetNone(PyExc_AssertionError);2842__PYX_ERR(0, 52, __pyx_L1_error)2843}2844}2845#endif28462847/* "numbers.pyx":532848* s += xgcd(92250, 922350 + i)[0]2849* assert s == 24144842850* return s # <<<<<<<<<<<<<<2851*2852* # 10x slower, of course2853*/2854__Pyx_XDECREF(__pyx_r);2855__Pyx_INCREF(__pyx_v_s);2856__pyx_r = __pyx_v_s;2857goto __pyx_L0;28582859/* "numbers.pyx":482860*2861*2862* def bench_xgcd_py(n=10**5): # <<<<<<<<<<<<<<2863* s = 02864* for i in range(n):2865*/28662867/* function exit code */2868__pyx_L1_error:;2869__Pyx_XDECREF(__pyx_t_1);2870__Pyx_XDECREF(__pyx_t_2);2871__Pyx_XDECREF(__pyx_t_5);2872__Pyx_XDECREF(__pyx_t_6);2873__Pyx_XDECREF(__pyx_t_7);2874__Pyx_XDECREF(__pyx_t_9);2875__Pyx_AddTraceback("numbers.bench_xgcd_py", __pyx_clineno, __pyx_lineno, __pyx_filename);2876__pyx_r = NULL;2877__pyx_L0:;2878__Pyx_XDECREF(__pyx_v_s);2879__Pyx_XDECREF(__pyx_v_i);2880__Pyx_XGIVEREF(__pyx_r);2881__Pyx_RefNannyFinishContext();2882return __pyx_r;2883}28842885/* "numbers.pyx":592886*2887*2888* def bench_xgcd(int n=10**5): # <<<<<<<<<<<<<<2889* cdef int s = 0, cx, cy, i2890* for i in range(n):2891*/28922893/* Python wrapper */2894static PyObject *__pyx_pw_7numbers_9bench_xgcd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/2895static PyMethodDef __pyx_mdef_7numbers_9bench_xgcd = {"bench_xgcd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_9bench_xgcd, METH_VARARGS|METH_KEYWORDS, 0};2896static PyObject *__pyx_pw_7numbers_9bench_xgcd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {2897int __pyx_v_n;2898int __pyx_lineno = 0;2899const char *__pyx_filename = NULL;2900int __pyx_clineno = 0;2901PyObject *__pyx_r = 0;2902__Pyx_RefNannyDeclarations2903__Pyx_RefNannySetupContext("bench_xgcd (wrapper)", 0);2904{2905static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};2906PyObject* values[1] = {0};2907if (unlikely(__pyx_kwds)) {2908Py_ssize_t kw_args;2909const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);2910switch (pos_args) {2911case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2912CYTHON_FALLTHROUGH;2913case 0: break;2914default: goto __pyx_L5_argtuple_error;2915}2916kw_args = PyDict_Size(__pyx_kwds);2917switch (pos_args) {2918case 0:2919if (kw_args > 0) {2920PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);2921if (value) { values[0] = value; kw_args--; }2922}2923}2924if (unlikely(kw_args > 0)) {2925if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bench_xgcd") < 0)) __PYX_ERR(0, 59, __pyx_L3_error)2926}2927} else {2928switch (PyTuple_GET_SIZE(__pyx_args)) {2929case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);2930CYTHON_FALLTHROUGH;2931case 0: break;2932default: goto __pyx_L5_argtuple_error;2933}2934}2935if (values[0]) {2936__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)2937} else {2938__pyx_v_n = ((int)0x186A0);2939}2940}2941goto __pyx_L4_argument_unpacking_done;2942__pyx_L5_argtuple_error:;2943__Pyx_RaiseArgtupleInvalid("bench_xgcd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error)2944__pyx_L3_error:;2945__Pyx_AddTraceback("numbers.bench_xgcd", __pyx_clineno, __pyx_lineno, __pyx_filename);2946__Pyx_RefNannyFinishContext();2947return NULL;2948__pyx_L4_argument_unpacking_done:;2949__pyx_r = __pyx_pf_7numbers_8bench_xgcd(__pyx_self, __pyx_v_n);29502951/* function exit code */2952__Pyx_RefNannyFinishContext();2953return __pyx_r;2954}29552956static PyObject *__pyx_pf_7numbers_8bench_xgcd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n) {2957int __pyx_v_s;2958int __pyx_v_cx;2959int __pyx_v_cy;2960int __pyx_v_i;2961PyObject *__pyx_r = NULL;2962__Pyx_RefNannyDeclarations2963int __pyx_t_1;2964int __pyx_t_2;2965int __pyx_t_3;2966PyObject *__pyx_t_4 = NULL;2967int __pyx_lineno = 0;2968const char *__pyx_filename = NULL;2969int __pyx_clineno = 0;2970__Pyx_RefNannySetupContext("bench_xgcd", 0);29712972/* "numbers.pyx":602973*2974* def bench_xgcd(int n=10**5):2975* cdef int s = 0, cx, cy, i # <<<<<<<<<<<<<<2976* for i in range(n):2977* s += xgcd_c(92250, 922350 + i, &cx, &cy)2978*/2979__pyx_v_s = 0;29802981/* "numbers.pyx":612982* def bench_xgcd(int n=10**5):2983* cdef int s = 0, cx, cy, i2984* for i in range(n): # <<<<<<<<<<<<<<2985* s += xgcd_c(92250, 922350 + i, &cx, &cy)2986* assert s == 24144842987*/2988__pyx_t_1 = __pyx_v_n;2989__pyx_t_2 = __pyx_t_1;2990for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {2991__pyx_v_i = __pyx_t_3;29922993/* "numbers.pyx":622994* cdef int s = 0, cx, cy, i2995* for i in range(n):2996* s += xgcd_c(92250, 922350 + i, &cx, &cy) # <<<<<<<<<<<<<<2997* assert s == 24144842998* return s2999*/3000__pyx_v_s = (__pyx_v_s + __pyx_f_2nt_xgcd_c(0x1685A, (0xE12EE + __pyx_v_i), (&__pyx_v_cx), (&__pyx_v_cy)));3001}30023003/* "numbers.pyx":633004* for i in range(n):3005* s += xgcd_c(92250, 922350 + i, &cx, &cy)3006* assert s == 2414484 # <<<<<<<<<<<<<<3007* return s3008*3009*/3010#ifndef CYTHON_WITHOUT_ASSERTIONS3011if (unlikely(!Py_OptimizeFlag)) {3012if (unlikely(!((__pyx_v_s == 0x24D794) != 0))) {3013PyErr_SetNone(PyExc_AssertionError);3014__PYX_ERR(0, 63, __pyx_L1_error)3015}3016}3017#endif30183019/* "numbers.pyx":643020* s += xgcd_c(92250, 922350 + i, &cx, &cy)3021* assert s == 24144843022* return s # <<<<<<<<<<<<<<3023*3024*3025*/3026__Pyx_XDECREF(__pyx_r);3027__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)3028__Pyx_GOTREF(__pyx_t_4);3029__pyx_r = __pyx_t_4;3030__pyx_t_4 = 0;3031goto __pyx_L0;30323033/* "numbers.pyx":593034*3035*3036* def bench_xgcd(int n=10**5): # <<<<<<<<<<<<<<3037* cdef int s = 0, cx, cy, i3038* for i in range(n):3039*/30403041/* function exit code */3042__pyx_L1_error:;3043__Pyx_XDECREF(__pyx_t_4);3044__Pyx_AddTraceback("numbers.bench_xgcd", __pyx_clineno, __pyx_lineno, __pyx_filename);3045__pyx_r = NULL;3046__pyx_L0:;3047__Pyx_XGIVEREF(__pyx_r);3048__Pyx_RefNannyFinishContext();3049return __pyx_r;3050}30513052/* "numbers.pyx":703053*3054*3055* def bench_inverse_mod(long long n=10**5): # <<<<<<<<<<<<<<3056* cdef long long i, s = 03057* for i in range(1, n):3058*/30593060/* Python wrapper */3061static PyObject *__pyx_pw_7numbers_11bench_inverse_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/3062static PyMethodDef __pyx_mdef_7numbers_11bench_inverse_mod = {"bench_inverse_mod", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_11bench_inverse_mod, METH_VARARGS|METH_KEYWORDS, 0};3063static PyObject *__pyx_pw_7numbers_11bench_inverse_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {3064PY_LONG_LONG __pyx_v_n;3065int __pyx_lineno = 0;3066const char *__pyx_filename = NULL;3067int __pyx_clineno = 0;3068PyObject *__pyx_r = 0;3069__Pyx_RefNannyDeclarations3070__Pyx_RefNannySetupContext("bench_inverse_mod (wrapper)", 0);3071{3072static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};3073PyObject* values[1] = {0};3074if (unlikely(__pyx_kwds)) {3075Py_ssize_t kw_args;3076const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);3077switch (pos_args) {3078case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3079CYTHON_FALLTHROUGH;3080case 0: break;3081default: goto __pyx_L5_argtuple_error;3082}3083kw_args = PyDict_Size(__pyx_kwds);3084switch (pos_args) {3085case 0:3086if (kw_args > 0) {3087PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);3088if (value) { values[0] = value; kw_args--; }3089}3090}3091if (unlikely(kw_args > 0)) {3092if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bench_inverse_mod") < 0)) __PYX_ERR(0, 70, __pyx_L3_error)3093}3094} else {3095switch (PyTuple_GET_SIZE(__pyx_args)) {3096case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3097CYTHON_FALLTHROUGH;3098case 0: break;3099default: goto __pyx_L5_argtuple_error;3100}3101}3102if (values[0]) {3103__pyx_v_n = __Pyx_PyInt_As_PY_LONG_LONG(values[0]); if (unlikely((__pyx_v_n == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error)3104} else {3105__pyx_v_n = ((PY_LONG_LONG)0x186A0);3106}3107}3108goto __pyx_L4_argument_unpacking_done;3109__pyx_L5_argtuple_error:;3110__Pyx_RaiseArgtupleInvalid("bench_inverse_mod", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error)3111__pyx_L3_error:;3112__Pyx_AddTraceback("numbers.bench_inverse_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);3113__Pyx_RefNannyFinishContext();3114return NULL;3115__pyx_L4_argument_unpacking_done:;3116__pyx_r = __pyx_pf_7numbers_10bench_inverse_mod(__pyx_self, __pyx_v_n);31173118/* function exit code */3119__Pyx_RefNannyFinishContext();3120return __pyx_r;3121}31223123static PyObject *__pyx_pf_7numbers_10bench_inverse_mod(CYTHON_UNUSED PyObject *__pyx_self, PY_LONG_LONG __pyx_v_n) {3124PY_LONG_LONG __pyx_v_i;3125PY_LONG_LONG __pyx_v_s;3126PyObject *__pyx_r = NULL;3127__Pyx_RefNannyDeclarations3128PY_LONG_LONG __pyx_t_1;3129PY_LONG_LONG __pyx_t_2;3130PY_LONG_LONG __pyx_t_3;3131PyObject *__pyx_t_4 = NULL;3132PyObject *__pyx_t_5 = NULL;3133int __pyx_t_6;3134int __pyx_lineno = 0;3135const char *__pyx_filename = NULL;3136int __pyx_clineno = 0;3137__Pyx_RefNannySetupContext("bench_inverse_mod", 0);31383139/* "numbers.pyx":713140*3141* def bench_inverse_mod(long long n=10**5):3142* cdef long long i, s = 0 # <<<<<<<<<<<<<<3143* for i in range(1, n):3144* s += inverse_mod(i, 1073741827) # nextprime(2^30)3145*/3146__pyx_v_s = 0;31473148/* "numbers.pyx":723149* def bench_inverse_mod(long long n=10**5):3150* cdef long long i, s = 03151* for i in range(1, n): # <<<<<<<<<<<<<<3152* s += inverse_mod(i, 1073741827) # nextprime(2^30)3153* assert s == 535323195339883154*/3155__pyx_t_1 = __pyx_v_n;3156__pyx_t_2 = __pyx_t_1;3157for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {3158__pyx_v_i = __pyx_t_3;31593160/* "numbers.pyx":733161* cdef long long i, s = 03162* for i in range(1, n):3163* s += inverse_mod(i, 1073741827) # nextprime(2^30) # <<<<<<<<<<<<<<3164* assert s == 535323195339883165*3166*/3167__pyx_v_s = (__pyx_v_s + __pyx_f_2nt_inverse_mod(__pyx_v_i, 0x40000003, 0));3168}31693170/* "numbers.pyx":743171* for i in range(1, n):3172* s += inverse_mod(i, 1073741827) # nextprime(2^30)3173* assert s == 53532319533988 # <<<<<<<<<<<<<<3174*3175*3176*/3177#ifndef CYTHON_WITHOUT_ASSERTIONS3178if (unlikely(!Py_OptimizeFlag)) {3179__pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)3180__Pyx_GOTREF(__pyx_t_4);3181__pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_53532319533988, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)3182__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;3183__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 74, __pyx_L1_error)3184__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;3185if (unlikely(!__pyx_t_6)) {3186PyErr_SetNone(PyExc_AssertionError);3187__PYX_ERR(0, 74, __pyx_L1_error)3188}3189}3190#endif31913192/* "numbers.pyx":703193*3194*3195* def bench_inverse_mod(long long n=10**5): # <<<<<<<<<<<<<<3196* cdef long long i, s = 03197* for i in range(1, n):3198*/31993200/* function exit code */3201__pyx_r = Py_None; __Pyx_INCREF(Py_None);3202goto __pyx_L0;3203__pyx_L1_error:;3204__Pyx_XDECREF(__pyx_t_4);3205__Pyx_XDECREF(__pyx_t_5);3206__Pyx_AddTraceback("numbers.bench_inverse_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);3207__pyx_r = NULL;3208__pyx_L0:;3209__Pyx_XGIVEREF(__pyx_r);3210__Pyx_RefNannyFinishContext();3211return __pyx_r;3212}32133214/* "numbers.pyx":803215*3216*3217* def sum_loop(int n=1000000): # <<<<<<<<<<<<<<3218* cdef int s = 0, i3219* for i in range(0, n, 3):3220*/32213222/* Python wrapper */3223static PyObject *__pyx_pw_7numbers_13sum_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/3224static PyMethodDef __pyx_mdef_7numbers_13sum_loop = {"sum_loop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_13sum_loop, METH_VARARGS|METH_KEYWORDS, 0};3225static PyObject *__pyx_pw_7numbers_13sum_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {3226int __pyx_v_n;3227int __pyx_lineno = 0;3228const char *__pyx_filename = NULL;3229int __pyx_clineno = 0;3230PyObject *__pyx_r = 0;3231__Pyx_RefNannyDeclarations3232__Pyx_RefNannySetupContext("sum_loop (wrapper)", 0);3233{3234static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};3235PyObject* values[1] = {0};3236if (unlikely(__pyx_kwds)) {3237Py_ssize_t kw_args;3238const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);3239switch (pos_args) {3240case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3241CYTHON_FALLTHROUGH;3242case 0: break;3243default: goto __pyx_L5_argtuple_error;3244}3245kw_args = PyDict_Size(__pyx_kwds);3246switch (pos_args) {3247case 0:3248if (kw_args > 0) {3249PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);3250if (value) { values[0] = value; kw_args--; }3251}3252}3253if (unlikely(kw_args > 0)) {3254if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sum_loop") < 0)) __PYX_ERR(0, 80, __pyx_L3_error)3255}3256} else {3257switch (PyTuple_GET_SIZE(__pyx_args)) {3258case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3259CYTHON_FALLTHROUGH;3260case 0: break;3261default: goto __pyx_L5_argtuple_error;3262}3263}3264if (values[0]) {3265__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)3266} else {3267__pyx_v_n = ((int)0xF4240);3268}3269}3270goto __pyx_L4_argument_unpacking_done;3271__pyx_L5_argtuple_error:;3272__Pyx_RaiseArgtupleInvalid("sum_loop", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 80, __pyx_L3_error)3273__pyx_L3_error:;3274__Pyx_AddTraceback("numbers.sum_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);3275__Pyx_RefNannyFinishContext();3276return NULL;3277__pyx_L4_argument_unpacking_done:;3278__pyx_r = __pyx_pf_7numbers_12sum_loop(__pyx_self, __pyx_v_n);32793280/* function exit code */3281__Pyx_RefNannyFinishContext();3282return __pyx_r;3283}32843285static PyObject *__pyx_pf_7numbers_12sum_loop(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n) {3286int __pyx_v_s;3287CYTHON_UNUSED int __pyx_v_i;3288PyObject *__pyx_r = NULL;3289__Pyx_RefNannyDeclarations3290int __pyx_t_1;3291int __pyx_t_2;3292int __pyx_t_3;3293PyObject *__pyx_t_4 = NULL;3294int __pyx_lineno = 0;3295const char *__pyx_filename = NULL;3296int __pyx_clineno = 0;3297__Pyx_RefNannySetupContext("sum_loop", 0);32983299/* "numbers.pyx":813300*3301* def sum_loop(int n=1000000):3302* cdef int s = 0, i # <<<<<<<<<<<<<<3303* for i in range(0, n, 3):3304* s += 13305*/3306__pyx_v_s = 0;33073308/* "numbers.pyx":823309* def sum_loop(int n=1000000):3310* cdef int s = 0, i3311* for i in range(0, n, 3): # <<<<<<<<<<<<<<3312* s += 13313* assert s == 3333343314*/3315__pyx_t_1 = __pyx_v_n;3316__pyx_t_2 = __pyx_t_1;3317for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=3) {3318__pyx_v_i = __pyx_t_3;33193320/* "numbers.pyx":833321* cdef int s = 0, i3322* for i in range(0, n, 3):3323* s += 1 # <<<<<<<<<<<<<<3324* assert s == 3333343325* return s3326*/3327__pyx_v_s = (__pyx_v_s + 1);3328}33293330/* "numbers.pyx":843331* for i in range(0, n, 3):3332* s += 13333* assert s == 333334 # <<<<<<<<<<<<<<3334* return s3335*3336*/3337#ifndef CYTHON_WITHOUT_ASSERTIONS3338if (unlikely(!Py_OptimizeFlag)) {3339if (unlikely(!((__pyx_v_s == 0x51616) != 0))) {3340PyErr_SetNone(PyExc_AssertionError);3341__PYX_ERR(0, 84, __pyx_L1_error)3342}3343}3344#endif33453346/* "numbers.pyx":853347* s += 13348* assert s == 3333343349* return s # <<<<<<<<<<<<<<3350*3351*3352*/3353__Pyx_XDECREF(__pyx_r);3354__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)3355__Pyx_GOTREF(__pyx_t_4);3356__pyx_r = __pyx_t_4;3357__pyx_t_4 = 0;3358goto __pyx_L0;33593360/* "numbers.pyx":803361*3362*3363* def sum_loop(int n=1000000): # <<<<<<<<<<<<<<3364* cdef int s = 0, i3365* for i in range(0, n, 3):3366*/33673368/* function exit code */3369__pyx_L1_error:;3370__Pyx_XDECREF(__pyx_t_4);3371__Pyx_AddTraceback("numbers.sum_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);3372__pyx_r = NULL;3373__pyx_L0:;3374__Pyx_XGIVEREF(__pyx_r);3375__Pyx_RefNannyFinishContext();3376return __pyx_r;3377}33783379/* "numbers.pyx":913380*3381*3382* def sum_range(long long n=1000000): # <<<<<<<<<<<<<<3383* n = sum(range(0, n, 3))3384* assert n == 1666668333333385*/33863387/* Python wrapper */3388static PyObject *__pyx_pw_7numbers_15sum_range(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/3389static PyMethodDef __pyx_mdef_7numbers_15sum_range = {"sum_range", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_15sum_range, METH_VARARGS|METH_KEYWORDS, 0};3390static PyObject *__pyx_pw_7numbers_15sum_range(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {3391PY_LONG_LONG __pyx_v_n;3392int __pyx_lineno = 0;3393const char *__pyx_filename = NULL;3394int __pyx_clineno = 0;3395PyObject *__pyx_r = 0;3396__Pyx_RefNannyDeclarations3397__Pyx_RefNannySetupContext("sum_range (wrapper)", 0);3398{3399static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};3400PyObject* values[1] = {0};3401if (unlikely(__pyx_kwds)) {3402Py_ssize_t kw_args;3403const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);3404switch (pos_args) {3405case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3406CYTHON_FALLTHROUGH;3407case 0: break;3408default: goto __pyx_L5_argtuple_error;3409}3410kw_args = PyDict_Size(__pyx_kwds);3411switch (pos_args) {3412case 0:3413if (kw_args > 0) {3414PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);3415if (value) { values[0] = value; kw_args--; }3416}3417}3418if (unlikely(kw_args > 0)) {3419if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sum_range") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)3420}3421} else {3422switch (PyTuple_GET_SIZE(__pyx_args)) {3423case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3424CYTHON_FALLTHROUGH;3425case 0: break;3426default: goto __pyx_L5_argtuple_error;3427}3428}3429if (values[0]) {3430__pyx_v_n = __Pyx_PyInt_As_PY_LONG_LONG(values[0]); if (unlikely((__pyx_v_n == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)3431} else {3432__pyx_v_n = ((PY_LONG_LONG)0xF4240);3433}3434}3435goto __pyx_L4_argument_unpacking_done;3436__pyx_L5_argtuple_error:;3437__Pyx_RaiseArgtupleInvalid("sum_range", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)3438__pyx_L3_error:;3439__Pyx_AddTraceback("numbers.sum_range", __pyx_clineno, __pyx_lineno, __pyx_filename);3440__Pyx_RefNannyFinishContext();3441return NULL;3442__pyx_L4_argument_unpacking_done:;3443__pyx_r = __pyx_pf_7numbers_14sum_range(__pyx_self, __pyx_v_n);34443445/* function exit code */3446__Pyx_RefNannyFinishContext();3447return __pyx_r;3448}34493450static PyObject *__pyx_pf_7numbers_14sum_range(CYTHON_UNUSED PyObject *__pyx_self, PY_LONG_LONG __pyx_v_n) {3451PyObject *__pyx_r = NULL;3452__Pyx_RefNannyDeclarations3453PyObject *__pyx_t_1 = NULL;3454PyObject *__pyx_t_2 = NULL;3455PY_LONG_LONG __pyx_t_3;3456int __pyx_t_4;3457int __pyx_lineno = 0;3458const char *__pyx_filename = NULL;3459int __pyx_clineno = 0;3460__Pyx_RefNannySetupContext("sum_range", 0);34613462/* "numbers.pyx":923463*3464* def sum_range(long long n=1000000):3465* n = sum(range(0, n, 3)) # <<<<<<<<<<<<<<3466* assert n == 1666668333333467*3468*/3469__pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)3470__Pyx_GOTREF(__pyx_t_1);3471__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)3472__Pyx_GOTREF(__pyx_t_2);3473__Pyx_INCREF(__pyx_int_0);3474__Pyx_GIVEREF(__pyx_int_0);3475PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);3476__Pyx_GIVEREF(__pyx_t_1);3477PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);3478__Pyx_INCREF(__pyx_int_3);3479__Pyx_GIVEREF(__pyx_int_3);3480PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_3);3481__pyx_t_1 = 0;3482__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)3483__Pyx_GOTREF(__pyx_t_1);3484__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3485__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)3486__Pyx_GOTREF(__pyx_t_2);3487__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3488__pyx_t_3 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)3489__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3490__pyx_v_n = __pyx_t_3;34913492/* "numbers.pyx":933493* def sum_range(long long n=1000000):3494* n = sum(range(0, n, 3))3495* assert n == 166666833333 # <<<<<<<<<<<<<<3496*3497*3498*/3499#ifndef CYTHON_WITHOUT_ASSERTIONS3500if (unlikely(!Py_OptimizeFlag)) {3501__pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)3502__Pyx_GOTREF(__pyx_t_2);3503__pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_166666833333, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)3504__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3505__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 93, __pyx_L1_error)3506__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3507if (unlikely(!__pyx_t_4)) {3508PyErr_SetNone(PyExc_AssertionError);3509__PYX_ERR(0, 93, __pyx_L1_error)3510}3511}3512#endif35133514/* "numbers.pyx":913515*3516*3517* def sum_range(long long n=1000000): # <<<<<<<<<<<<<<3518* n = sum(range(0, n, 3))3519* assert n == 1666668333333520*/35213522/* function exit code */3523__pyx_r = Py_None; __Pyx_INCREF(Py_None);3524goto __pyx_L0;3525__pyx_L1_error:;3526__Pyx_XDECREF(__pyx_t_1);3527__Pyx_XDECREF(__pyx_t_2);3528__Pyx_AddTraceback("numbers.sum_range", __pyx_clineno, __pyx_lineno, __pyx_filename);3529__pyx_r = NULL;3530__pyx_L0:;3531__Pyx_XGIVEREF(__pyx_r);3532__Pyx_RefNannyFinishContext();3533return __pyx_r;3534}35353536/* "numbers.pyx":993537*3538*3539* def sum_reversed(long long n=1000000): # <<<<<<<<<<<<<<3540* n = sum(reversed(list(range(0, n, 3))))3541* assert n == 1666668333333542*/35433544/* Python wrapper */3545static PyObject *__pyx_pw_7numbers_17sum_reversed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/3546static PyMethodDef __pyx_mdef_7numbers_17sum_reversed = {"sum_reversed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_17sum_reversed, METH_VARARGS|METH_KEYWORDS, 0};3547static PyObject *__pyx_pw_7numbers_17sum_reversed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {3548PY_LONG_LONG __pyx_v_n;3549int __pyx_lineno = 0;3550const char *__pyx_filename = NULL;3551int __pyx_clineno = 0;3552PyObject *__pyx_r = 0;3553__Pyx_RefNannyDeclarations3554__Pyx_RefNannySetupContext("sum_reversed (wrapper)", 0);3555{3556static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};3557PyObject* values[1] = {0};3558if (unlikely(__pyx_kwds)) {3559Py_ssize_t kw_args;3560const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);3561switch (pos_args) {3562case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3563CYTHON_FALLTHROUGH;3564case 0: break;3565default: goto __pyx_L5_argtuple_error;3566}3567kw_args = PyDict_Size(__pyx_kwds);3568switch (pos_args) {3569case 0:3570if (kw_args > 0) {3571PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);3572if (value) { values[0] = value; kw_args--; }3573}3574}3575if (unlikely(kw_args > 0)) {3576if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sum_reversed") < 0)) __PYX_ERR(0, 99, __pyx_L3_error)3577}3578} else {3579switch (PyTuple_GET_SIZE(__pyx_args)) {3580case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3581CYTHON_FALLTHROUGH;3582case 0: break;3583default: goto __pyx_L5_argtuple_error;3584}3585}3586if (values[0]) {3587__pyx_v_n = __Pyx_PyInt_As_PY_LONG_LONG(values[0]); if (unlikely((__pyx_v_n == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L3_error)3588} else {3589__pyx_v_n = ((PY_LONG_LONG)0xF4240);3590}3591}3592goto __pyx_L4_argument_unpacking_done;3593__pyx_L5_argtuple_error:;3594__Pyx_RaiseArgtupleInvalid("sum_reversed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 99, __pyx_L3_error)3595__pyx_L3_error:;3596__Pyx_AddTraceback("numbers.sum_reversed", __pyx_clineno, __pyx_lineno, __pyx_filename);3597__Pyx_RefNannyFinishContext();3598return NULL;3599__pyx_L4_argument_unpacking_done:;3600__pyx_r = __pyx_pf_7numbers_16sum_reversed(__pyx_self, __pyx_v_n);36013602/* function exit code */3603__Pyx_RefNannyFinishContext();3604return __pyx_r;3605}36063607static PyObject *__pyx_pf_7numbers_16sum_reversed(CYTHON_UNUSED PyObject *__pyx_self, PY_LONG_LONG __pyx_v_n) {3608PyObject *__pyx_r = NULL;3609__Pyx_RefNannyDeclarations3610PyObject *__pyx_t_1 = NULL;3611PyObject *__pyx_t_2 = NULL;3612PY_LONG_LONG __pyx_t_3;3613int __pyx_t_4;3614int __pyx_lineno = 0;3615const char *__pyx_filename = NULL;3616int __pyx_clineno = 0;3617__Pyx_RefNannySetupContext("sum_reversed", 0);36183619/* "numbers.pyx":1003620*3621* def sum_reversed(long long n=1000000):3622* n = sum(reversed(list(range(0, n, 3)))) # <<<<<<<<<<<<<<3623* assert n == 1666668333333624*3625*/3626__pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)3627__Pyx_GOTREF(__pyx_t_1);3628__pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)3629__Pyx_GOTREF(__pyx_t_2);3630__Pyx_INCREF(__pyx_int_0);3631__Pyx_GIVEREF(__pyx_int_0);3632PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);3633__Pyx_GIVEREF(__pyx_t_1);3634PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);3635__Pyx_INCREF(__pyx_int_3);3636__Pyx_GIVEREF(__pyx_int_3);3637PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_3);3638__pyx_t_1 = 0;3639__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)3640__Pyx_GOTREF(__pyx_t_1);3641__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3642__pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)3643__Pyx_GOTREF(__pyx_t_2);3644__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3645__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)3646__Pyx_GOTREF(__pyx_t_1);3647__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3648__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)3649__Pyx_GOTREF(__pyx_t_2);3650__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3651__pyx_t_3 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)3652__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3653__pyx_v_n = __pyx_t_3;36543655/* "numbers.pyx":1013656* def sum_reversed(long long n=1000000):3657* n = sum(reversed(list(range(0, n, 3))))3658* assert n == 166666833333 # <<<<<<<<<<<<<<3659*3660*3661*/3662#ifndef CYTHON_WITHOUT_ASSERTIONS3663if (unlikely(!Py_OptimizeFlag)) {3664__pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)3665__Pyx_GOTREF(__pyx_t_2);3666__pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_166666833333, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)3667__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;3668__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 101, __pyx_L1_error)3669__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3670if (unlikely(!__pyx_t_4)) {3671PyErr_SetNone(PyExc_AssertionError);3672__PYX_ERR(0, 101, __pyx_L1_error)3673}3674}3675#endif36763677/* "numbers.pyx":993678*3679*3680* def sum_reversed(long long n=1000000): # <<<<<<<<<<<<<<3681* n = sum(reversed(list(range(0, n, 3))))3682* assert n == 1666668333333683*/36843685/* function exit code */3686__pyx_r = Py_None; __Pyx_INCREF(Py_None);3687goto __pyx_L0;3688__pyx_L1_error:;3689__Pyx_XDECREF(__pyx_t_1);3690__Pyx_XDECREF(__pyx_t_2);3691__Pyx_AddTraceback("numbers.sum_reversed", __pyx_clineno, __pyx_lineno, __pyx_filename);3692__pyx_r = NULL;3693__pyx_L0:;3694__Pyx_XGIVEREF(__pyx_r);3695__Pyx_RefNannyFinishContext();3696return __pyx_r;3697}36983699/* "(tree fragment)":13700* def __pyx_unpickle_A(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<3701* cdef object __pyx_PickleError3702* cdef object __pyx_result3703*/37043705/* Python wrapper */3706static PyObject *__pyx_pw_7numbers_19__pyx_unpickle_A(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/3707static PyMethodDef __pyx_mdef_7numbers_19__pyx_unpickle_A = {"__pyx_unpickle_A", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7numbers_19__pyx_unpickle_A, METH_VARARGS|METH_KEYWORDS, 0};3708static PyObject *__pyx_pw_7numbers_19__pyx_unpickle_A(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {3709PyObject *__pyx_v___pyx_type = 0;3710long __pyx_v___pyx_checksum;3711PyObject *__pyx_v___pyx_state = 0;3712int __pyx_lineno = 0;3713const char *__pyx_filename = NULL;3714int __pyx_clineno = 0;3715PyObject *__pyx_r = 0;3716__Pyx_RefNannyDeclarations3717__Pyx_RefNannySetupContext("__pyx_unpickle_A (wrapper)", 0);3718{3719static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};3720PyObject* values[3] = {0,0,0};3721if (unlikely(__pyx_kwds)) {3722Py_ssize_t kw_args;3723const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);3724switch (pos_args) {3725case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);3726CYTHON_FALLTHROUGH;3727case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);3728CYTHON_FALLTHROUGH;3729case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3730CYTHON_FALLTHROUGH;3731case 0: break;3732default: goto __pyx_L5_argtuple_error;3733}3734kw_args = PyDict_Size(__pyx_kwds);3735switch (pos_args) {3736case 0:3737if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;3738else goto __pyx_L5_argtuple_error;3739CYTHON_FALLTHROUGH;3740case 1:3741if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;3742else {3743__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_A", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)3744}3745CYTHON_FALLTHROUGH;3746case 2:3747if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;3748else {3749__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_A", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)3750}3751}3752if (unlikely(kw_args > 0)) {3753if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_A") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)3754}3755} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {3756goto __pyx_L5_argtuple_error;3757} else {3758values[0] = PyTuple_GET_ITEM(__pyx_args, 0);3759values[1] = PyTuple_GET_ITEM(__pyx_args, 1);3760values[2] = PyTuple_GET_ITEM(__pyx_args, 2);3761}3762__pyx_v___pyx_type = values[0];3763__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)3764__pyx_v___pyx_state = values[2];3765}3766goto __pyx_L4_argument_unpacking_done;3767__pyx_L5_argtuple_error:;3768__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_A", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)3769__pyx_L3_error:;3770__Pyx_AddTraceback("numbers.__pyx_unpickle_A", __pyx_clineno, __pyx_lineno, __pyx_filename);3771__Pyx_RefNannyFinishContext();3772return NULL;3773__pyx_L4_argument_unpacking_done:;3774__pyx_r = __pyx_pf_7numbers_18__pyx_unpickle_A(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);37753776/* function exit code */3777__Pyx_RefNannyFinishContext();3778return __pyx_r;3779}37803781static PyObject *__pyx_pf_7numbers_18__pyx_unpickle_A(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {3782PyObject *__pyx_v___pyx_PickleError = 0;3783PyObject *__pyx_v___pyx_result = 0;3784PyObject *__pyx_r = NULL;3785__Pyx_RefNannyDeclarations3786PyObject *__pyx_t_1 = NULL;3787int __pyx_t_2;3788int __pyx_t_3;3789PyObject *__pyx_t_4 = NULL;3790PyObject *__pyx_t_5 = NULL;3791PyObject *__pyx_t_6 = NULL;3792int __pyx_lineno = 0;3793const char *__pyx_filename = NULL;3794int __pyx_clineno = 0;3795__Pyx_RefNannySetupContext("__pyx_unpickle_A", 0);37963797/* "(tree fragment)":43798* cdef object __pyx_PickleError3799* cdef object __pyx_result3800* if __pyx_checksum not in (0x865c0c0, 0xde7d1b7, 0x042dc45): # <<<<<<<<<<<<<<3801* from pickle import PickleError as __pyx_PickleError3802* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)3803*/3804__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)3805__Pyx_GOTREF(__pyx_t_1);3806__pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__3, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)3807__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3808__pyx_t_3 = (__pyx_t_2 != 0);3809if (__pyx_t_3) {38103811/* "(tree fragment)":53812* cdef object __pyx_result3813* if __pyx_checksum not in (0x865c0c0, 0xde7d1b7, 0x042dc45):3814* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<3815* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)3816* __pyx_result = A.__new__(__pyx_type)3817*/3818__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)3819__Pyx_GOTREF(__pyx_t_1);3820__Pyx_INCREF(__pyx_n_s_PickleError);3821__Pyx_GIVEREF(__pyx_n_s_PickleError);3822PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);3823__pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)3824__Pyx_GOTREF(__pyx_t_4);3825__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3826__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)3827__Pyx_GOTREF(__pyx_t_1);3828__Pyx_INCREF(__pyx_t_1);3829__pyx_v___pyx_PickleError = __pyx_t_1;3830__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3831__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;38323833/* "(tree fragment)":63834* if __pyx_checksum not in (0x865c0c0, 0xde7d1b7, 0x042dc45):3835* from pickle import PickleError as __pyx_PickleError3836* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum) # <<<<<<<<<<<<<<3837* __pyx_result = A.__new__(__pyx_type)3838* if __pyx_state is not None:3839*/3840__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)3841__Pyx_GOTREF(__pyx_t_1);3842__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)3843__Pyx_GOTREF(__pyx_t_5);3844__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3845__Pyx_INCREF(__pyx_v___pyx_PickleError);3846__pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;3847if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {3848__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);3849if (likely(__pyx_t_6)) {3850PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);3851__Pyx_INCREF(__pyx_t_6);3852__Pyx_INCREF(function);3853__Pyx_DECREF_SET(__pyx_t_1, function);3854}3855}3856__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);3857__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;3858__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;3859if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)3860__Pyx_GOTREF(__pyx_t_4);3861__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3862__Pyx_Raise(__pyx_t_4, 0, 0, 0);3863__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;3864__PYX_ERR(1, 6, __pyx_L1_error)38653866/* "(tree fragment)":43867* cdef object __pyx_PickleError3868* cdef object __pyx_result3869* if __pyx_checksum not in (0x865c0c0, 0xde7d1b7, 0x042dc45): # <<<<<<<<<<<<<<3870* from pickle import PickleError as __pyx_PickleError3871* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)3872*/3873}38743875/* "(tree fragment)":73876* from pickle import PickleError as __pyx_PickleError3877* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)3878* __pyx_result = A.__new__(__pyx_type) # <<<<<<<<<<<<<<3879* if __pyx_state is not None:3880* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state)3881*/3882__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7numbers_A), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)3883__Pyx_GOTREF(__pyx_t_1);3884__pyx_t_5 = NULL;3885if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {3886__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);3887if (likely(__pyx_t_5)) {3888PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);3889__Pyx_INCREF(__pyx_t_5);3890__Pyx_INCREF(function);3891__Pyx_DECREF_SET(__pyx_t_1, function);3892}3893}3894__pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);3895__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;3896if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)3897__Pyx_GOTREF(__pyx_t_4);3898__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;3899__pyx_v___pyx_result = __pyx_t_4;3900__pyx_t_4 = 0;39013902/* "(tree fragment)":83903* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)3904* __pyx_result = A.__new__(__pyx_type)3905* if __pyx_state is not None: # <<<<<<<<<<<<<<3906* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state)3907* return __pyx_result3908*/3909__pyx_t_3 = (__pyx_v___pyx_state != Py_None);3910__pyx_t_2 = (__pyx_t_3 != 0);3911if (__pyx_t_2) {39123913/* "(tree fragment)":93914* __pyx_result = A.__new__(__pyx_type)3915* if __pyx_state is not None:3916* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<3917* return __pyx_result3918* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state):3919*/3920if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)3921__pyx_t_4 = __pyx_f_7numbers___pyx_unpickle_A__set_state(((struct __pyx_obj_7numbers_A *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)3922__Pyx_GOTREF(__pyx_t_4);3923__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;39243925/* "(tree fragment)":83926* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)3927* __pyx_result = A.__new__(__pyx_type)3928* if __pyx_state is not None: # <<<<<<<<<<<<<<3929* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state)3930* return __pyx_result3931*/3932}39333934/* "(tree fragment)":103935* if __pyx_state is not None:3936* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state)3937* return __pyx_result # <<<<<<<<<<<<<<3938* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state):3939* __pyx_result.i = __pyx_state[0]3940*/3941__Pyx_XDECREF(__pyx_r);3942__Pyx_INCREF(__pyx_v___pyx_result);3943__pyx_r = __pyx_v___pyx_result;3944goto __pyx_L0;39453946/* "(tree fragment)":13947* def __pyx_unpickle_A(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<3948* cdef object __pyx_PickleError3949* cdef object __pyx_result3950*/39513952/* function exit code */3953__pyx_L1_error:;3954__Pyx_XDECREF(__pyx_t_1);3955__Pyx_XDECREF(__pyx_t_4);3956__Pyx_XDECREF(__pyx_t_5);3957__Pyx_XDECREF(__pyx_t_6);3958__Pyx_AddTraceback("numbers.__pyx_unpickle_A", __pyx_clineno, __pyx_lineno, __pyx_filename);3959__pyx_r = NULL;3960__pyx_L0:;3961__Pyx_XDECREF(__pyx_v___pyx_PickleError);3962__Pyx_XDECREF(__pyx_v___pyx_result);3963__Pyx_XGIVEREF(__pyx_r);3964__Pyx_RefNannyFinishContext();3965return __pyx_r;3966}39673968/* "(tree fragment)":113969* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state)3970* return __pyx_result3971* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<3972* __pyx_result.i = __pyx_state[0]3973* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):3974*/39753976static PyObject *__pyx_f_7numbers___pyx_unpickle_A__set_state(struct __pyx_obj_7numbers_A *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {3977PyObject *__pyx_r = NULL;3978__Pyx_RefNannyDeclarations3979PyObject *__pyx_t_1 = NULL;3980int __pyx_t_2;3981int __pyx_t_3;3982Py_ssize_t __pyx_t_4;3983int __pyx_t_5;3984int __pyx_t_6;3985PyObject *__pyx_t_7 = NULL;3986PyObject *__pyx_t_8 = NULL;3987PyObject *__pyx_t_9 = NULL;3988int __pyx_lineno = 0;3989const char *__pyx_filename = NULL;3990int __pyx_clineno = 0;3991__Pyx_RefNannySetupContext("__pyx_unpickle_A__set_state", 0);39923993/* "(tree fragment)":123994* return __pyx_result3995* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state):3996* __pyx_result.i = __pyx_state[0] # <<<<<<<<<<<<<<3997* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):3998* __pyx_result.__dict__.update(__pyx_state[1])3999*/4000if (unlikely(__pyx_v___pyx_state == Py_None)) {4001PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");4002__PYX_ERR(1, 12, __pyx_L1_error)4003}4004__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)4005__Pyx_GOTREF(__pyx_t_1);4006__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)4007__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4008__pyx_v___pyx_result->i = __pyx_t_2;40094010/* "(tree fragment)":134011* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state):4012* __pyx_result.i = __pyx_state[0]4013* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<4014* __pyx_result.__dict__.update(__pyx_state[1])4015*/4016if (unlikely(__pyx_v___pyx_state == Py_None)) {4017PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");4018__PYX_ERR(1, 13, __pyx_L1_error)4019}4020__pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)4021__pyx_t_5 = ((__pyx_t_4 > 1) != 0);4022if (__pyx_t_5) {4023} else {4024__pyx_t_3 = __pyx_t_5;4025goto __pyx_L4_bool_binop_done;4026}4027__pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)4028__pyx_t_6 = (__pyx_t_5 != 0);4029__pyx_t_3 = __pyx_t_6;4030__pyx_L4_bool_binop_done:;4031if (__pyx_t_3) {40324033/* "(tree fragment)":144034* __pyx_result.i = __pyx_state[0]4035* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):4036* __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<4037*/4038__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)4039__Pyx_GOTREF(__pyx_t_7);4040__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)4041__Pyx_GOTREF(__pyx_t_8);4042__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;4043if (unlikely(__pyx_v___pyx_state == Py_None)) {4044PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");4045__PYX_ERR(1, 14, __pyx_L1_error)4046}4047__pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)4048__Pyx_GOTREF(__pyx_t_7);4049__pyx_t_9 = NULL;4050if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {4051__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);4052if (likely(__pyx_t_9)) {4053PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);4054__Pyx_INCREF(__pyx_t_9);4055__Pyx_INCREF(function);4056__Pyx_DECREF_SET(__pyx_t_8, function);4057}4058}4059__pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);4060__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;4061__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;4062if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)4063__Pyx_GOTREF(__pyx_t_1);4064__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;4065__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;40664067/* "(tree fragment)":134068* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state):4069* __pyx_result.i = __pyx_state[0]4070* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<4071* __pyx_result.__dict__.update(__pyx_state[1])4072*/4073}40744075/* "(tree fragment)":114076* __pyx_unpickle_A__set_state(<A> __pyx_result, __pyx_state)4077* return __pyx_result4078* cdef __pyx_unpickle_A__set_state(A __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<4079* __pyx_result.i = __pyx_state[0]4080* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):4081*/40824083/* function exit code */4084__pyx_r = Py_None; __Pyx_INCREF(Py_None);4085goto __pyx_L0;4086__pyx_L1_error:;4087__Pyx_XDECREF(__pyx_t_1);4088__Pyx_XDECREF(__pyx_t_7);4089__Pyx_XDECREF(__pyx_t_8);4090__Pyx_XDECREF(__pyx_t_9);4091__Pyx_AddTraceback("numbers.__pyx_unpickle_A__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);4092__pyx_r = 0;4093__pyx_L0:;4094__Pyx_XGIVEREF(__pyx_r);4095__Pyx_RefNannyFinishContext();4096return __pyx_r;4097}40984099static PyObject *__pyx_tp_new_7numbers_A(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {4100PyObject *o;4101if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {4102o = (*t->tp_alloc)(t, 0);4103} else {4104o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);4105}4106if (unlikely(!o)) return 0;4107return o;4108}41094110static void __pyx_tp_dealloc_7numbers_A(PyObject *o) {4111#if CYTHON_USE_TP_FINALIZE4112if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {4113if (PyObject_CallFinalizerFromDealloc(o)) return;4114}4115#endif4116(*Py_TYPE(o)->tp_free)(o);4117}41184119static PyMethodDef __pyx_methods_7numbers_A[] = {4120{"value", (PyCFunction)__pyx_pw_7numbers_1A_3value, METH_NOARGS, 0},4121{"__reduce_cython__", (PyCFunction)__pyx_pw_7numbers_1A_7__reduce_cython__, METH_NOARGS, 0},4122{"__setstate_cython__", (PyCFunction)__pyx_pw_7numbers_1A_9__setstate_cython__, METH_O, 0},4123{0, 0, 0, 0}4124};41254126static PyNumberMethods __pyx_tp_as_number_A = {4127__pyx_pw_7numbers_1A_5__add__, /*nb_add*/41280, /*nb_subtract*/41290, /*nb_multiply*/4130#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)41310, /*nb_divide*/4132#endif41330, /*nb_remainder*/41340, /*nb_divmod*/41350, /*nb_power*/41360, /*nb_negative*/41370, /*nb_positive*/41380, /*nb_absolute*/41390, /*nb_nonzero*/41400, /*nb_invert*/41410, /*nb_lshift*/41420, /*nb_rshift*/41430, /*nb_and*/41440, /*nb_xor*/41450, /*nb_or*/4146#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)41470, /*nb_coerce*/4148#endif41490, /*nb_int*/4150#if PY_MAJOR_VERSION < 341510, /*nb_long*/4152#else41530, /*reserved*/4154#endif41550, /*nb_float*/4156#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)41570, /*nb_oct*/4158#endif4159#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)41600, /*nb_hex*/4161#endif41620, /*nb_inplace_add*/41630, /*nb_inplace_subtract*/41640, /*nb_inplace_multiply*/4165#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)41660, /*nb_inplace_divide*/4167#endif41680, /*nb_inplace_remainder*/41690, /*nb_inplace_power*/41700, /*nb_inplace_lshift*/41710, /*nb_inplace_rshift*/41720, /*nb_inplace_and*/41730, /*nb_inplace_xor*/41740, /*nb_inplace_or*/41750, /*nb_floor_divide*/41760, /*nb_true_divide*/41770, /*nb_inplace_floor_divide*/41780, /*nb_inplace_true_divide*/41790, /*nb_index*/4180#if PY_VERSION_HEX >= 0x0305000041810, /*nb_matrix_multiply*/4182#endif4183#if PY_VERSION_HEX >= 0x0305000041840, /*nb_inplace_matrix_multiply*/4185#endif4186};41874188static PyTypeObject __pyx_type_7numbers_A = {4189PyVarObject_HEAD_INIT(0, 0)4190"numbers.A", /*tp_name*/4191sizeof(struct __pyx_obj_7numbers_A), /*tp_basicsize*/41920, /*tp_itemsize*/4193__pyx_tp_dealloc_7numbers_A, /*tp_dealloc*/4194#if PY_VERSION_HEX < 0x030800b441950, /*tp_print*/4196#endif4197#if PY_VERSION_HEX >= 0x030800b441980, /*tp_vectorcall_offset*/4199#endif42000, /*tp_getattr*/42010, /*tp_setattr*/4202#if PY_MAJOR_VERSION < 342030, /*tp_compare*/4204#endif4205#if PY_MAJOR_VERSION >= 342060, /*tp_as_async*/4207#endif42080, /*tp_repr*/4209&__pyx_tp_as_number_A, /*tp_as_number*/42100, /*tp_as_sequence*/42110, /*tp_as_mapping*/42120, /*tp_hash*/42130, /*tp_call*/42140, /*tp_str*/42150, /*tp_getattro*/42160, /*tp_setattro*/42170, /*tp_as_buffer*/4218Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/42190, /*tp_doc*/42200, /*tp_traverse*/42210, /*tp_clear*/42220, /*tp_richcompare*/42230, /*tp_weaklistoffset*/42240, /*tp_iter*/42250, /*tp_iternext*/4226__pyx_methods_7numbers_A, /*tp_methods*/42270, /*tp_members*/42280, /*tp_getset*/42290, /*tp_base*/42300, /*tp_dict*/42310, /*tp_descr_get*/42320, /*tp_descr_set*/42330, /*tp_dictoffset*/4234__pyx_pw_7numbers_1A_1__init__, /*tp_init*/42350, /*tp_alloc*/4236__pyx_tp_new_7numbers_A, /*tp_new*/42370, /*tp_free*/42380, /*tp_is_gc*/42390, /*tp_bases*/42400, /*tp_mro*/42410, /*tp_cache*/42420, /*tp_subclasses*/42430, /*tp_weaklist*/42440, /*tp_del*/42450, /*tp_version_tag*/4246#if PY_VERSION_HEX >= 0x030400a142470, /*tp_finalize*/4248#endif4249#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)42500, /*tp_vectorcall*/4251#endif4252#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x0309000042530, /*tp_print*/4254#endif4255#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x0309000042560, /*tp_pypy_flags*/4257#endif4258};42594260static PyMethodDef __pyx_methods[] = {4261{0, 0, 0, 0}4262};42634264#if PY_MAJOR_VERSION >= 34265#if CYTHON_PEP489_MULTI_PHASE_INIT4266static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/4267static int __pyx_pymod_exec_numbers(PyObject* module); /*proto*/4268static PyModuleDef_Slot __pyx_moduledef_slots[] = {4269{Py_mod_create, (void*)__pyx_pymod_create},4270{Py_mod_exec, (void*)__pyx_pymod_exec_numbers},4271{0, NULL}4272};4273#endif42744275static struct PyModuleDef __pyx_moduledef = {4276PyModuleDef_HEAD_INIT,4277"numbers",42780, /* m_doc */4279#if CYTHON_PEP489_MULTI_PHASE_INIT42800, /* m_size */4281#else4282-1, /* m_size */4283#endif4284__pyx_methods /* m_methods */,4285#if CYTHON_PEP489_MULTI_PHASE_INIT4286__pyx_moduledef_slots, /* m_slots */4287#else4288NULL, /* m_reload */4289#endif4290NULL, /* m_traverse */4291NULL, /* m_clear */4292NULL /* m_free */4293};4294#endif4295#ifndef CYTHON_SMALL_CODE4296#if defined(__clang__)4297#define CYTHON_SMALL_CODE4298#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))4299#define CYTHON_SMALL_CODE __attribute__((cold))4300#else4301#define CYTHON_SMALL_CODE4302#endif4303#endif43044305static __Pyx_StringTabEntry __pyx_string_tab[] = {4306{&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},4307{&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},4308{&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},4309{&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},4310{&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},4311{&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},4312{&__pyx_n_s_bench, __pyx_k_bench, sizeof(__pyx_k_bench), 0, 0, 1, 1},4313{&__pyx_n_s_bench_gcd, __pyx_k_bench_gcd, sizeof(__pyx_k_bench_gcd), 0, 0, 1, 1},4314{&__pyx_n_s_bench_inverse_mod, __pyx_k_bench_inverse_mod, sizeof(__pyx_k_bench_inverse_mod), 0, 0, 1, 1},4315{&__pyx_n_s_bench_xgcd, __pyx_k_bench_xgcd, sizeof(__pyx_k_bench_xgcd), 0, 0, 1, 1},4316{&__pyx_n_s_bench_xgcd_py, __pyx_k_bench_xgcd_py, sizeof(__pyx_k_bench_xgcd_py), 0, 0, 1, 1},4317{&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},4318{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},4319{&__pyx_n_s_cx, __pyx_k_cx, sizeof(__pyx_k_cx), 0, 0, 1, 1},4320{&__pyx_n_s_cy, __pyx_k_cy, sizeof(__pyx_k_cy), 0, 0, 1, 1},4321{&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},4322{&__pyx_n_s_gcd, __pyx_k_gcd, sizeof(__pyx_k_gcd), 0, 0, 1, 1},4323{&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},4324{&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},4325{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},4326{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},4327{&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},4328{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},4329{&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},4330{&__pyx_n_s_nt, __pyx_k_nt, sizeof(__pyx_k_nt), 0, 0, 1, 1},4331{&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1},4332{&__pyx_kp_s_numbers_pyx, __pyx_k_numbers_pyx, sizeof(__pyx_k_numbers_pyx), 0, 0, 1, 0},4333{&__pyx_n_s_operator_add, __pyx_k_operator_add, sizeof(__pyx_k_operator_add), 0, 0, 1, 1},4334{&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},4335{&__pyx_kp_s_pi_10_5, __pyx_k_pi_10_5, sizeof(__pyx_k_pi_10_5), 0, 0, 1, 0},4336{&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},4337{&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},4338{&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},4339{&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},4340{&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},4341{&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},4342{&__pyx_n_s_pyx_unpickle_A, __pyx_k_pyx_unpickle_A, sizeof(__pyx_k_pyx_unpickle_A), 0, 0, 1, 1},4343{&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},4344{&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},4345{&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},4346{&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},4347{&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},4348{&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},4349{&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},4350{&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},4351{&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},4352{&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},4353{&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},4354{&__pyx_n_s_sum_loop, __pyx_k_sum_loop, sizeof(__pyx_k_sum_loop), 0, 0, 1, 1},4355{&__pyx_n_s_sum_range, __pyx_k_sum_range, sizeof(__pyx_k_sum_range), 0, 0, 1, 1},4356{&__pyx_n_s_sum_reversed, __pyx_k_sum_reversed, sizeof(__pyx_k_sum_reversed), 0, 0, 1, 1},4357{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},4358{&__pyx_n_s_test_pi, __pyx_k_test_pi, sizeof(__pyx_k_test_pi), 0, 0, 1, 1},4359{&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},4360{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},4361{&__pyx_n_s_xgcd, __pyx_k_xgcd, sizeof(__pyx_k_xgcd), 0, 0, 1, 1},4362{0, 0, 0, 0, 0, 0, 0}4363};4364static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {4365__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 28, __pyx_L1_error)4366__pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 92, __pyx_L1_error)4367__pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 100, __pyx_L1_error)4368return 0;4369__pyx_L1_error:;4370return -1;4371}43724373static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {4374__Pyx_RefNannyDeclarations4375__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);43764377/* "numbers.pyx":254378* def operator_add(int n=100000):4379*4380* a = A(2) # <<<<<<<<<<<<<<4381* b = A(3)4382* cdef int i4383*/4384__pyx_tuple_ = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error)4385__Pyx_GOTREF(__pyx_tuple_);4386__Pyx_GIVEREF(__pyx_tuple_);43874388/* "numbers.pyx":264389*4390* a = A(2)4391* b = A(3) # <<<<<<<<<<<<<<4392* cdef int i4393* for i in range(n):4394*/4395__pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 26, __pyx_L1_error)4396__Pyx_GOTREF(__pyx_tuple__2);4397__Pyx_GIVEREF(__pyx_tuple__2);43984399/* "(tree fragment)":44400* cdef object __pyx_PickleError4401* cdef object __pyx_result4402* if __pyx_checksum not in (0x865c0c0, 0xde7d1b7, 0x042dc45): # <<<<<<<<<<<<<<4403* from pickle import PickleError as __pyx_PickleError4404* raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x865c0c0, 0xde7d1b7, 0x042dc45) = (i))" % __pyx_checksum)4405*/4406__pyx_tuple__3 = PyTuple_Pack(3, __pyx_int_140886208, __pyx_int_233296311, __pyx_int_4381765); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)4407__Pyx_GOTREF(__pyx_tuple__3);4408__Pyx_GIVEREF(__pyx_tuple__3);44094410/* "numbers.pyx":64411* from nt cimport gcd, xgcd_c, inverse_mod4412*4413* def test_pi(n=100000): # <<<<<<<<<<<<<<4414* assert pi(n) == 95924415*4416*/4417__pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_n); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 6, __pyx_L1_error)4418__Pyx_GOTREF(__pyx_tuple__4);4419__Pyx_GIVEREF(__pyx_tuple__4);4420__pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_test_pi, 6, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 6, __pyx_L1_error)44214422/* "numbers.pyx":234423* return A((<A>self).i + (<A>right).i)4424*4425* def operator_add(int n=100000): # <<<<<<<<<<<<<<4426*4427* a = A(2)4428*/4429__pyx_tuple__6 = PyTuple_Pack(5, __pyx_n_s_n, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_i, __pyx_n_s_c); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 23, __pyx_L1_error)4430__Pyx_GOTREF(__pyx_tuple__6);4431__Pyx_GIVEREF(__pyx_tuple__6);4432__pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_operator_add, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 23, __pyx_L1_error)44334434/* "numbers.pyx":364435*4436*4437* def bench_gcd(int n=10**5): # <<<<<<<<<<<<<<4438* cdef int s = 04439* cdef int i4440*/4441__pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_n, __pyx_n_s_s, __pyx_n_s_i); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 36, __pyx_L1_error)4442__Pyx_GOTREF(__pyx_tuple__8);4443__Pyx_GIVEREF(__pyx_tuple__8);4444__pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_bench_gcd, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 36, __pyx_L1_error)44454446/* "numbers.pyx":484447*4448*4449* def bench_xgcd_py(n=10**5): # <<<<<<<<<<<<<<4450* s = 04451* for i in range(n):4452*/4453__pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_n, __pyx_n_s_s, __pyx_n_s_i); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 48, __pyx_L1_error)4454__Pyx_GOTREF(__pyx_tuple__10);4455__Pyx_GIVEREF(__pyx_tuple__10);4456__pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_bench_xgcd_py, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 48, __pyx_L1_error)44574458/* "numbers.pyx":594459*4460*4461* def bench_xgcd(int n=10**5): # <<<<<<<<<<<<<<4462* cdef int s = 0, cx, cy, i4463* for i in range(n):4464*/4465__pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_n, __pyx_n_s_s, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_i); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 59, __pyx_L1_error)4466__Pyx_GOTREF(__pyx_tuple__12);4467__Pyx_GIVEREF(__pyx_tuple__12);4468__pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_bench_xgcd, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 59, __pyx_L1_error)44694470/* "numbers.pyx":704471*4472*4473* def bench_inverse_mod(long long n=10**5): # <<<<<<<<<<<<<<4474* cdef long long i, s = 04475* for i in range(1, n):4476*/4477__pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_s); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 70, __pyx_L1_error)4478__Pyx_GOTREF(__pyx_tuple__14);4479__Pyx_GIVEREF(__pyx_tuple__14);4480__pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_bench_inverse_mod, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 70, __pyx_L1_error)44814482/* "numbers.pyx":804483*4484*4485* def sum_loop(int n=1000000): # <<<<<<<<<<<<<<4486* cdef int s = 0, i4487* for i in range(0, n, 3):4488*/4489__pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_n, __pyx_n_s_s, __pyx_n_s_i); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 80, __pyx_L1_error)4490__Pyx_GOTREF(__pyx_tuple__16);4491__Pyx_GIVEREF(__pyx_tuple__16);4492__pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_sum_loop, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 80, __pyx_L1_error)44934494/* "numbers.pyx":914495*4496*4497* def sum_range(long long n=1000000): # <<<<<<<<<<<<<<4498* n = sum(range(0, n, 3))4499* assert n == 1666668333334500*/4501__pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_n); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 91, __pyx_L1_error)4502__Pyx_GOTREF(__pyx_tuple__18);4503__Pyx_GIVEREF(__pyx_tuple__18);4504__pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_sum_range, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 91, __pyx_L1_error)45054506/* "numbers.pyx":994507*4508*4509* def sum_reversed(long long n=1000000): # <<<<<<<<<<<<<<4510* n = sum(reversed(list(range(0, n, 3))))4511* assert n == 1666668333334512*/4513__pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_n); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 99, __pyx_L1_error)4514__Pyx_GOTREF(__pyx_tuple__20);4515__Pyx_GIVEREF(__pyx_tuple__20);4516__pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numbers_pyx, __pyx_n_s_sum_reversed, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 99, __pyx_L1_error)45174518/* "numbers.pyx":1074519*4520* if __name__ == '__main__':4521* all('numbers') # <<<<<<<<<<<<<<4522*/4523__pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_numbers); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 107, __pyx_L1_error)4524__Pyx_GOTREF(__pyx_tuple__22);4525__Pyx_GIVEREF(__pyx_tuple__22);45264527/* "(tree fragment)":14528* def __pyx_unpickle_A(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<4529* cdef object __pyx_PickleError4530* cdef object __pyx_result4531*/4532__pyx_tuple__23 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 1, __pyx_L1_error)4533__Pyx_GOTREF(__pyx_tuple__23);4534__Pyx_GIVEREF(__pyx_tuple__23);4535__pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_A, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 1, __pyx_L1_error)4536__Pyx_RefNannyFinishContext();4537return 0;4538__pyx_L1_error:;4539__Pyx_RefNannyFinishContext();4540return -1;4541}45424543static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {4544if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);4545__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)4546__pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)4547__pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)4548__pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)4549__pyx_int_9592 = PyInt_FromLong(9592); if (unlikely(!__pyx_int_9592)) __PYX_ERR(0, 1, __pyx_L1_error)4550__pyx_int_92250 = PyInt_FromLong(92250L); if (unlikely(!__pyx_int_92250)) __PYX_ERR(0, 1, __pyx_L1_error)4551__pyx_int_100000 = PyInt_FromLong(100000L); if (unlikely(!__pyx_int_100000)) __PYX_ERR(0, 1, __pyx_L1_error)4552__pyx_int_922350 = PyInt_FromLong(922350L); if (unlikely(!__pyx_int_922350)) __PYX_ERR(0, 1, __pyx_L1_error)4553__pyx_int_2414484 = PyInt_FromLong(2414484L); if (unlikely(!__pyx_int_2414484)) __PYX_ERR(0, 1, __pyx_L1_error)4554__pyx_int_4381765 = PyInt_FromLong(4381765L); if (unlikely(!__pyx_int_4381765)) __PYX_ERR(0, 1, __pyx_L1_error)4555__pyx_int_140886208 = PyInt_FromLong(140886208L); if (unlikely(!__pyx_int_140886208)) __PYX_ERR(0, 1, __pyx_L1_error)4556__pyx_int_233296311 = PyInt_FromLong(233296311L); if (unlikely(!__pyx_int_233296311)) __PYX_ERR(0, 1, __pyx_L1_error)4557__pyx_int_166666833333 = PyInt_FromString((char *)"166666833333", 0, 0); if (unlikely(!__pyx_int_166666833333)) __PYX_ERR(0, 1, __pyx_L1_error)4558__pyx_int_53532319533988 = PyInt_FromString((char *)"53532319533988", 0, 0); if (unlikely(!__pyx_int_53532319533988)) __PYX_ERR(0, 1, __pyx_L1_error)4559return 0;4560__pyx_L1_error:;4561return -1;4562}45634564static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/4565static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/4566static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/4567static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/4568static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/4569static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/4570static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/45714572static int __Pyx_modinit_global_init_code(void) {4573__Pyx_RefNannyDeclarations4574__Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);4575/*--- Global init code ---*/4576__Pyx_RefNannyFinishContext();4577return 0;4578}45794580static int __Pyx_modinit_variable_export_code(void) {4581__Pyx_RefNannyDeclarations4582__Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);4583/*--- Variable export code ---*/4584__Pyx_RefNannyFinishContext();4585return 0;4586}45874588static int __Pyx_modinit_function_export_code(void) {4589__Pyx_RefNannyDeclarations4590__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);4591/*--- Function export code ---*/4592__Pyx_RefNannyFinishContext();4593return 0;4594}45954596static int __Pyx_modinit_type_init_code(void) {4597__Pyx_RefNannyDeclarations4598int __pyx_lineno = 0;4599const char *__pyx_filename = NULL;4600int __pyx_clineno = 0;4601__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);4602/*--- Type init code ---*/4603if (PyType_Ready(&__pyx_type_7numbers_A) < 0) __PYX_ERR(0, 12, __pyx_L1_error)4604#if PY_VERSION_HEX < 0x030800B14605__pyx_type_7numbers_A.tp_print = 0;4606#endif4607if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7numbers_A.tp_dictoffset && __pyx_type_7numbers_A.tp_getattro == PyObject_GenericGetAttr)) {4608__pyx_type_7numbers_A.tp_getattro = __Pyx_PyObject_GenericGetAttr;4609}4610if (PyObject_SetAttr(__pyx_m, __pyx_n_s_A, (PyObject *)&__pyx_type_7numbers_A) < 0) __PYX_ERR(0, 12, __pyx_L1_error)4611if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7numbers_A) < 0) __PYX_ERR(0, 12, __pyx_L1_error)4612__pyx_ptype_7numbers_A = &__pyx_type_7numbers_A;4613__Pyx_RefNannyFinishContext();4614return 0;4615__pyx_L1_error:;4616__Pyx_RefNannyFinishContext();4617return -1;4618}46194620static int __Pyx_modinit_type_import_code(void) {4621__Pyx_RefNannyDeclarations4622__Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);4623/*--- Type import code ---*/4624__Pyx_RefNannyFinishContext();4625return 0;4626}46274628static int __Pyx_modinit_variable_import_code(void) {4629__Pyx_RefNannyDeclarations4630__Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);4631/*--- Variable import code ---*/4632__Pyx_RefNannyFinishContext();4633return 0;4634}46354636static int __Pyx_modinit_function_import_code(void) {4637__Pyx_RefNannyDeclarations4638PyObject *__pyx_t_1 = NULL;4639int __pyx_lineno = 0;4640const char *__pyx_filename = NULL;4641int __pyx_clineno = 0;4642__Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);4643/*--- Function import code ---*/4644__pyx_t_1 = PyImport_ImportModule("nt"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)4645__Pyx_GOTREF(__pyx_t_1);4646if (__Pyx_ImportFunction(__pyx_t_1, "gcd", (void (**)(void))&__pyx_f_2nt_gcd, "int (int, int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)4647if (__Pyx_ImportFunction(__pyx_t_1, "xgcd_c", (void (**)(void))&__pyx_f_2nt_xgcd_c, "int (int, int, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)4648if (__Pyx_ImportFunction(__pyx_t_1, "inverse_mod", (void (**)(void))&__pyx_f_2nt_inverse_mod, "int (int, int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)4649__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4650__Pyx_RefNannyFinishContext();4651return 0;4652__pyx_L1_error:;4653__Pyx_XDECREF(__pyx_t_1);4654__Pyx_RefNannyFinishContext();4655return -1;4656}465746584659#ifndef CYTHON_NO_PYINIT_EXPORT4660#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC4661#elif PY_MAJOR_VERSION < 34662#ifdef __cplusplus4663#define __Pyx_PyMODINIT_FUNC extern "C" void4664#else4665#define __Pyx_PyMODINIT_FUNC void4666#endif4667#else4668#ifdef __cplusplus4669#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *4670#else4671#define __Pyx_PyMODINIT_FUNC PyObject *4672#endif4673#endif467446754676#if PY_MAJOR_VERSION < 34677__Pyx_PyMODINIT_FUNC initnumbers(void) CYTHON_SMALL_CODE; /*proto*/4678__Pyx_PyMODINIT_FUNC initnumbers(void)4679#else4680__Pyx_PyMODINIT_FUNC PyInit_numbers(void) CYTHON_SMALL_CODE; /*proto*/4681__Pyx_PyMODINIT_FUNC PyInit_numbers(void)4682#if CYTHON_PEP489_MULTI_PHASE_INIT4683{4684return PyModuleDef_Init(&__pyx_moduledef);4685}4686static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {4687#if PY_VERSION_HEX >= 0x030700A14688static PY_INT64_T main_interpreter_id = -1;4689PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);4690if (main_interpreter_id == -1) {4691main_interpreter_id = current_id;4692return (unlikely(current_id == -1)) ? -1 : 0;4693} else if (unlikely(main_interpreter_id != current_id))4694#else4695static PyInterpreterState *main_interpreter = NULL;4696PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;4697if (!main_interpreter) {4698main_interpreter = current_interpreter;4699} else if (unlikely(main_interpreter != current_interpreter))4700#endif4701{4702PyErr_SetString(4703PyExc_ImportError,4704"Interpreter change detected - this module can only be loaded into one interpreter per process.");4705return -1;4706}4707return 0;4708}4709static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {4710PyObject *value = PyObject_GetAttrString(spec, from_name);4711int result = 0;4712if (likely(value)) {4713if (allow_none || value != Py_None) {4714result = PyDict_SetItemString(moddict, to_name, value);4715}4716Py_DECREF(value);4717} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {4718PyErr_Clear();4719} else {4720result = -1;4721}4722return result;4723}4724static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {4725PyObject *module = NULL, *moddict, *modname;4726if (__Pyx_check_single_interpreter())4727return NULL;4728if (__pyx_m)4729return __Pyx_NewRef(__pyx_m);4730modname = PyObject_GetAttrString(spec, "name");4731if (unlikely(!modname)) goto bad;4732module = PyModule_NewObject(modname);4733Py_DECREF(modname);4734if (unlikely(!module)) goto bad;4735moddict = PyModule_GetDict(module);4736if (unlikely(!moddict)) goto bad;4737if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;4738if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;4739if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;4740if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;4741return module;4742bad:4743Py_XDECREF(module);4744return NULL;4745}474647474748static CYTHON_SMALL_CODE int __pyx_pymod_exec_numbers(PyObject *__pyx_pyinit_module)4749#endif4750#endif4751{4752PyObject *__pyx_t_1 = NULL;4753PyObject *__pyx_t_2 = NULL;4754PyObject *__pyx_t_3 = NULL;4755int __pyx_t_4;4756int __pyx_lineno = 0;4757const char *__pyx_filename = NULL;4758int __pyx_clineno = 0;4759__Pyx_RefNannyDeclarations4760#if CYTHON_PEP489_MULTI_PHASE_INIT4761if (__pyx_m) {4762if (__pyx_m == __pyx_pyinit_module) return 0;4763PyErr_SetString(PyExc_RuntimeError, "Module 'numbers' has already been imported. Re-initialisation is not supported.");4764return -1;4765}4766#elif PY_MAJOR_VERSION >= 34767if (__pyx_m) return __Pyx_NewRef(__pyx_m);4768#endif4769#if CYTHON_REFNANNY4770__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");4771if (!__Pyx_RefNanny) {4772PyErr_Clear();4773__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");4774if (!__Pyx_RefNanny)4775Py_FatalError("failed to import 'refnanny' module");4776}4777#endif4778__Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_numbers(void)", 0);4779if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4780#ifdef __Pxy_PyFrame_Initialize_Offsets4781__Pxy_PyFrame_Initialize_Offsets();4782#endif4783__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)4784__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)4785__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)4786#ifdef __Pyx_CyFunction_USED4787if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4788#endif4789#ifdef __Pyx_FusedFunction_USED4790if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4791#endif4792#ifdef __Pyx_Coroutine_USED4793if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4794#endif4795#ifdef __Pyx_Generator_USED4796if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4797#endif4798#ifdef __Pyx_AsyncGen_USED4799if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4800#endif4801#ifdef __Pyx_StopAsyncIteration_USED4802if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4803#endif4804/*--- Library function declarations ---*/4805/*--- Threads initialization code ---*/4806#if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS4807PyEval_InitThreads();4808#endif4809/*--- Module creation code ---*/4810#if CYTHON_PEP489_MULTI_PHASE_INIT4811__pyx_m = __pyx_pyinit_module;4812Py_INCREF(__pyx_m);4813#else4814#if PY_MAJOR_VERSION < 34815__pyx_m = Py_InitModule4("numbers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);4816#else4817__pyx_m = PyModule_Create(&__pyx_moduledef);4818#endif4819if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)4820#endif4821__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)4822Py_INCREF(__pyx_d);4823__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)4824Py_INCREF(__pyx_b);4825__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)4826Py_INCREF(__pyx_cython_runtime);4827if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);4828/*--- Initialize various global constants etc. ---*/4829if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4830#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)4831if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4832#endif4833if (__pyx_module_is_main_numbers) {4834if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)4835}4836#if PY_MAJOR_VERSION >= 34837{4838PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)4839if (!PyDict_GetItemString(modules, "numbers")) {4840if (unlikely(PyDict_SetItemString(modules, "numbers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)4841}4842}4843#endif4844/*--- Builtin init code ---*/4845if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4846/*--- Constants init code ---*/4847if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4848/*--- Global type/function init code ---*/4849(void)__Pyx_modinit_global_init_code();4850(void)__Pyx_modinit_variable_export_code();4851(void)__Pyx_modinit_function_export_code();4852if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)4853(void)__Pyx_modinit_type_import_code();4854(void)__Pyx_modinit_variable_import_code();4855if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)4856/*--- Execution code ---*/4857#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)4858if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)4859#endif48604861/* "numbers.pyx":14862* from bench import register, all # <<<<<<<<<<<<<<4863*4864* from nt import xgcd, pi4865*/4866__pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)4867__Pyx_GOTREF(__pyx_t_1);4868__Pyx_INCREF(__pyx_n_s_register);4869__Pyx_GIVEREF(__pyx_n_s_register);4870PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_register);4871__Pyx_INCREF(__pyx_n_s_all);4872__Pyx_GIVEREF(__pyx_n_s_all);4873PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_all);4874__pyx_t_2 = __Pyx_Import(__pyx_n_s_bench, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)4875__Pyx_GOTREF(__pyx_t_2);4876__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4877__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)4878__Pyx_GOTREF(__pyx_t_1);4879if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)4880__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4881__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)4882__Pyx_GOTREF(__pyx_t_1);4883if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)4884__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4885__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;48864887/* "numbers.pyx":34888* from bench import register, all4889*4890* from nt import xgcd, pi # <<<<<<<<<<<<<<4891* from nt cimport gcd, xgcd_c, inverse_mod4892*4893*/4894__pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)4895__Pyx_GOTREF(__pyx_t_2);4896__Pyx_INCREF(__pyx_n_s_xgcd);4897__Pyx_GIVEREF(__pyx_n_s_xgcd);4898PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_xgcd);4899__Pyx_INCREF(__pyx_n_s_pi);4900__Pyx_GIVEREF(__pyx_n_s_pi);4901PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_pi);4902__pyx_t_1 = __Pyx_Import(__pyx_n_s_nt, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)4903__Pyx_GOTREF(__pyx_t_1);4904__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;4905__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_xgcd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)4906__Pyx_GOTREF(__pyx_t_2);4907if (PyDict_SetItem(__pyx_d, __pyx_n_s_xgcd, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)4908__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;4909__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)4910__Pyx_GOTREF(__pyx_t_2);4911if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)4912__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;4913__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;49144915/* "numbers.pyx":64916* from nt cimport gcd, xgcd_c, inverse_mod4917*4918* def test_pi(n=100000): # <<<<<<<<<<<<<<4919* assert pi(n) == 95924920*4921*/4922__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7numbers_1test_pi, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)4923__Pyx_GOTREF(__pyx_t_1);4924if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_pi, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)4925__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;49264927/* "numbers.pyx":104928*4929*4930* register("pi(10**5)", pi) # <<<<<<<<<<<<<<4931*4932* cdef class A:4933*/4934__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)4935__Pyx_GOTREF(__pyx_t_1);4936__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)4937__Pyx_GOTREF(__pyx_t_2);4938__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error)4939__Pyx_GOTREF(__pyx_t_3);4940__Pyx_INCREF(__pyx_kp_s_pi_10_5);4941__Pyx_GIVEREF(__pyx_kp_s_pi_10_5);4942PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_pi_10_5);4943__Pyx_GIVEREF(__pyx_t_2);4944PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);4945__pyx_t_2 = 0;4946__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)4947__Pyx_GOTREF(__pyx_t_2);4948__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4949__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;4950__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;49514952/* "numbers.pyx":234953* return A((<A>self).i + (<A>right).i)4954*4955* def operator_add(int n=100000): # <<<<<<<<<<<<<<4956*4957* a = A(2)4958*/4959__pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7numbers_3operator_add, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)4960__Pyx_GOTREF(__pyx_t_2);4961if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator_add, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)4962__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;49634964/* "numbers.pyx":334965*4966*4967* register("operator_add", operator_add) # <<<<<<<<<<<<<<4968*4969*4970*/4971__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)4972__Pyx_GOTREF(__pyx_t_2);4973__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_operator_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)4974__Pyx_GOTREF(__pyx_t_3);4975__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)4976__Pyx_GOTREF(__pyx_t_1);4977__Pyx_INCREF(__pyx_n_s_operator_add);4978__Pyx_GIVEREF(__pyx_n_s_operator_add);4979PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_operator_add);4980__Pyx_GIVEREF(__pyx_t_3);4981PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);4982__pyx_t_3 = 0;4983__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)4984__Pyx_GOTREF(__pyx_t_3);4985__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;4986__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;4987__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;49884989/* "numbers.pyx":364990*4991*4992* def bench_gcd(int n=10**5): # <<<<<<<<<<<<<<4993* cdef int s = 04994* cdef int i4995*/4996__pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_7numbers_5bench_gcd, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)4997__Pyx_GOTREF(__pyx_t_3);4998if (PyDict_SetItem(__pyx_d, __pyx_n_s_bench_gcd, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error)4999__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;50005001/* "numbers.pyx":455002*5003*5004* register("gcd", bench_gcd) # <<<<<<<<<<<<<<5005*5006*5007*/5008__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)5009__Pyx_GOTREF(__pyx_t_3);5010__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bench_gcd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)5011__Pyx_GOTREF(__pyx_t_1);5012__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)5013__Pyx_GOTREF(__pyx_t_2);5014__Pyx_INCREF(__pyx_n_s_gcd);5015__Pyx_GIVEREF(__pyx_n_s_gcd);5016PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gcd);5017__Pyx_GIVEREF(__pyx_t_1);5018PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);5019__pyx_t_1 = 0;5020__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)5021__Pyx_GOTREF(__pyx_t_1);5022__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;5023__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;5024__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;50255026/* "numbers.pyx":485027*5028*5029* def bench_xgcd_py(n=10**5): # <<<<<<<<<<<<<<5030* s = 05031* for i in range(n):5032*/5033__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7numbers_7bench_xgcd_py, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)5034__Pyx_GOTREF(__pyx_t_1);5035if (PyDict_SetItem(__pyx_d, __pyx_n_s_bench_xgcd_py, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)5036__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;50375038/* "numbers.pyx":595039*5040*5041* def bench_xgcd(int n=10**5): # <<<<<<<<<<<<<<5042* cdef int s = 0, cx, cy, i5043* for i in range(n):5044*/5045__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7numbers_9bench_xgcd, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)5046__Pyx_GOTREF(__pyx_t_1);5047if (PyDict_SetItem(__pyx_d, __pyx_n_s_bench_xgcd, __pyx_t_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error)5048__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;50495050/* "numbers.pyx":675051*5052*5053* register("xgcd", bench_xgcd) # <<<<<<<<<<<<<<5054*5055*5056*/5057__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)5058__Pyx_GOTREF(__pyx_t_1);5059__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bench_xgcd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)5060__Pyx_GOTREF(__pyx_t_2);5061__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)5062__Pyx_GOTREF(__pyx_t_3);5063__Pyx_INCREF(__pyx_n_s_xgcd);5064__Pyx_GIVEREF(__pyx_n_s_xgcd);5065PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_xgcd);5066__Pyx_GIVEREF(__pyx_t_2);5067PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);5068__pyx_t_2 = 0;5069__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)5070__Pyx_GOTREF(__pyx_t_2);5071__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;5072__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;5073__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;50745075/* "numbers.pyx":705076*5077*5078* def bench_inverse_mod(long long n=10**5): # <<<<<<<<<<<<<<5079* cdef long long i, s = 05080* for i in range(1, n):5081*/5082__pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7numbers_11bench_inverse_mod, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)5083__Pyx_GOTREF(__pyx_t_2);5084if (PyDict_SetItem(__pyx_d, __pyx_n_s_bench_inverse_mod, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)5085__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;50865087/* "numbers.pyx":775088*5089*5090* register("bench_inverse_mod", bench_inverse_mod) # <<<<<<<<<<<<<<5091*5092*5093*/5094__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)5095__Pyx_GOTREF(__pyx_t_2);5096__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bench_inverse_mod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)5097__Pyx_GOTREF(__pyx_t_3);5098__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)5099__Pyx_GOTREF(__pyx_t_1);5100__Pyx_INCREF(__pyx_n_s_bench_inverse_mod);5101__Pyx_GIVEREF(__pyx_n_s_bench_inverse_mod);5102PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bench_inverse_mod);5103__Pyx_GIVEREF(__pyx_t_3);5104PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);5105__pyx_t_3 = 0;5106__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)5107__Pyx_GOTREF(__pyx_t_3);5108__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;5109__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;5110__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;51115112/* "numbers.pyx":805113*5114*5115* def sum_loop(int n=1000000): # <<<<<<<<<<<<<<5116* cdef int s = 0, i5117* for i in range(0, n, 3):5118*/5119__pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_7numbers_13sum_loop, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)5120__Pyx_GOTREF(__pyx_t_3);5121if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_loop, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error)5122__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;51235124/* "numbers.pyx":885125*5126*5127* register("sum_loop", sum_loop) # <<<<<<<<<<<<<<5128*5129*5130*/5131__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)5132__Pyx_GOTREF(__pyx_t_3);5133__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sum_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)5134__Pyx_GOTREF(__pyx_t_1);5135__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)5136__Pyx_GOTREF(__pyx_t_2);5137__Pyx_INCREF(__pyx_n_s_sum_loop);5138__Pyx_GIVEREF(__pyx_n_s_sum_loop);5139PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_sum_loop);5140__Pyx_GIVEREF(__pyx_t_1);5141PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);5142__pyx_t_1 = 0;5143__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)5144__Pyx_GOTREF(__pyx_t_1);5145__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;5146__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;5147__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;51485149/* "numbers.pyx":915150*5151*5152* def sum_range(long long n=1000000): # <<<<<<<<<<<<<<5153* n = sum(range(0, n, 3))5154* assert n == 1666668333335155*/5156__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7numbers_15sum_range, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)5157__Pyx_GOTREF(__pyx_t_1);5158if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_range, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)5159__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;51605161/* "numbers.pyx":965162*5163*5164* register("sum_range", sum_range) # <<<<<<<<<<<<<<5165*5166*5167*/5168__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)5169__Pyx_GOTREF(__pyx_t_1);5170__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sum_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)5171__Pyx_GOTREF(__pyx_t_2);5172__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)5173__Pyx_GOTREF(__pyx_t_3);5174__Pyx_INCREF(__pyx_n_s_sum_range);5175__Pyx_GIVEREF(__pyx_n_s_sum_range);5176PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_sum_range);5177__Pyx_GIVEREF(__pyx_t_2);5178PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);5179__pyx_t_2 = 0;5180__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)5181__Pyx_GOTREF(__pyx_t_2);5182__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;5183__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;5184__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;51855186/* "numbers.pyx":995187*5188*5189* def sum_reversed(long long n=1000000): # <<<<<<<<<<<<<<5190* n = sum(reversed(list(range(0, n, 3))))5191* assert n == 1666668333335192*/5193__pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7numbers_17sum_reversed, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)5194__Pyx_GOTREF(__pyx_t_2);5195if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_reversed, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error)5196__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;51975198/* "numbers.pyx":1045199*5200*5201* register("sum_reversed", sum_reversed) # <<<<<<<<<<<<<<5202*5203* if __name__ == '__main__':5204*/5205__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)5206__Pyx_GOTREF(__pyx_t_2);5207__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sum_reversed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)5208__Pyx_GOTREF(__pyx_t_3);5209__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)5210__Pyx_GOTREF(__pyx_t_1);5211__Pyx_INCREF(__pyx_n_s_sum_reversed);5212__Pyx_GIVEREF(__pyx_n_s_sum_reversed);5213PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_sum_reversed);5214__Pyx_GIVEREF(__pyx_t_3);5215PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);5216__pyx_t_3 = 0;5217__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)5218__Pyx_GOTREF(__pyx_t_3);5219__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;5220__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;5221__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;52225223/* "numbers.pyx":1065224* register("sum_reversed", sum_reversed)5225*5226* if __name__ == '__main__': # <<<<<<<<<<<<<<5227* all('numbers')5228*/5229__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)5230__Pyx_GOTREF(__pyx_t_3);5231__pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 106, __pyx_L1_error)5232__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;5233if (__pyx_t_4) {52345235/* "numbers.pyx":1075236*5237* if __name__ == '__main__':5238* all('numbers') # <<<<<<<<<<<<<<5239*/5240__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)5241__Pyx_GOTREF(__pyx_t_3);5242__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)5243__Pyx_GOTREF(__pyx_t_1);5244__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;5245__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;52465247/* "numbers.pyx":1065248* register("sum_reversed", sum_reversed)5249*5250* if __name__ == '__main__': # <<<<<<<<<<<<<<5251* all('numbers')5252*/5253}52545255/* "(tree fragment)":15256* def __pyx_unpickle_A(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<5257* cdef object __pyx_PickleError5258* cdef object __pyx_result5259*/5260__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7numbers_19__pyx_unpickle_A, NULL, __pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)5261__Pyx_GOTREF(__pyx_t_1);5262if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_A, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)5263__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;52645265/* "numbers.pyx":15266* from bench import register, all # <<<<<<<<<<<<<<5267*5268* from nt import xgcd, pi5269*/5270__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)5271__Pyx_GOTREF(__pyx_t_1);5272if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)5273__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;52745275/*--- Wrapped vars code ---*/52765277goto __pyx_L0;5278__pyx_L1_error:;5279__Pyx_XDECREF(__pyx_t_1);5280__Pyx_XDECREF(__pyx_t_2);5281__Pyx_XDECREF(__pyx_t_3);5282if (__pyx_m) {5283if (__pyx_d) {5284__Pyx_AddTraceback("init numbers", __pyx_clineno, __pyx_lineno, __pyx_filename);5285}5286Py_CLEAR(__pyx_m);5287} else if (!PyErr_Occurred()) {5288PyErr_SetString(PyExc_ImportError, "init numbers");5289}5290__pyx_L0:;5291__Pyx_RefNannyFinishContext();5292#if CYTHON_PEP489_MULTI_PHASE_INIT5293return (__pyx_m != NULL) ? 0 : -1;5294#elif PY_MAJOR_VERSION >= 35295return __pyx_m;5296#else5297return;5298#endif5299}53005301/* --- Runtime support code --- */5302/* Refnanny */5303#if CYTHON_REFNANNY5304static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {5305PyObject *m = NULL, *p = NULL;5306void *r = NULL;5307m = PyImport_ImportModule(modname);5308if (!m) goto end;5309p = PyObject_GetAttrString(m, "RefNannyAPI");5310if (!p) goto end;5311r = PyLong_AsVoidPtr(p);5312end:5313Py_XDECREF(p);5314Py_XDECREF(m);5315return (__Pyx_RefNannyAPIStruct *)r;5316}5317#endif53185319/* PyObjectGetAttrStr */5320#if CYTHON_USE_TYPE_SLOTS5321static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {5322PyTypeObject* tp = Py_TYPE(obj);5323if (likely(tp->tp_getattro))5324return tp->tp_getattro(obj, attr_name);5325#if PY_MAJOR_VERSION < 35326if (likely(tp->tp_getattr))5327return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));5328#endif5329return PyObject_GetAttr(obj, attr_name);5330}5331#endif53325333/* GetBuiltinName */5334static PyObject *__Pyx_GetBuiltinName(PyObject *name) {5335PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);5336if (unlikely(!result)) {5337PyErr_Format(PyExc_NameError,5338#if PY_MAJOR_VERSION >= 35339"name '%U' is not defined", name);5340#else5341"name '%.200s' is not defined", PyString_AS_STRING(name));5342#endif5343}5344return result;5345}53465347/* RaiseDoubleKeywords */5348static void __Pyx_RaiseDoubleKeywordsError(5349const char* func_name,5350PyObject* kw_name)5351{5352PyErr_Format(PyExc_TypeError,5353#if PY_MAJOR_VERSION >= 35354"%s() got multiple values for keyword argument '%U'", func_name, kw_name);5355#else5356"%s() got multiple values for keyword argument '%s'", func_name,5357PyString_AsString(kw_name));5358#endif5359}53605361/* ParseKeywords */5362static int __Pyx_ParseOptionalKeywords(5363PyObject *kwds,5364PyObject **argnames[],5365PyObject *kwds2,5366PyObject *values[],5367Py_ssize_t num_pos_args,5368const char* function_name)5369{5370PyObject *key = 0, *value = 0;5371Py_ssize_t pos = 0;5372PyObject*** name;5373PyObject*** first_kw_arg = argnames + num_pos_args;5374while (PyDict_Next(kwds, &pos, &key, &value)) {5375name = first_kw_arg;5376while (*name && (**name != key)) name++;5377if (*name) {5378values[name-argnames] = value;5379continue;5380}5381name = first_kw_arg;5382#if PY_MAJOR_VERSION < 35383if (likely(PyString_Check(key))) {5384while (*name) {5385if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))5386&& _PyString_Eq(**name, key)) {5387values[name-argnames] = value;5388break;5389}5390name++;5391}5392if (*name) continue;5393else {5394PyObject*** argname = argnames;5395while (argname != first_kw_arg) {5396if ((**argname == key) || (5397(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))5398&& _PyString_Eq(**argname, key))) {5399goto arg_passed_twice;5400}5401argname++;5402}5403}5404} else5405#endif5406if (likely(PyUnicode_Check(key))) {5407while (*name) {5408int cmp = (**name == key) ? 0 :5409#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 35410(__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :5411#endif5412PyUnicode_Compare(**name, key);5413if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;5414if (cmp == 0) {5415values[name-argnames] = value;5416break;5417}5418name++;5419}5420if (*name) continue;5421else {5422PyObject*** argname = argnames;5423while (argname != first_kw_arg) {5424int cmp = (**argname == key) ? 0 :5425#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 35426(__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :5427#endif5428PyUnicode_Compare(**argname, key);5429if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;5430if (cmp == 0) goto arg_passed_twice;5431argname++;5432}5433}5434} else5435goto invalid_keyword_type;5436if (kwds2) {5437if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;5438} else {5439goto invalid_keyword;5440}5441}5442return 0;5443arg_passed_twice:5444__Pyx_RaiseDoubleKeywordsError(function_name, key);5445goto bad;5446invalid_keyword_type:5447PyErr_Format(PyExc_TypeError,5448"%.200s() keywords must be strings", function_name);5449goto bad;5450invalid_keyword:5451PyErr_Format(PyExc_TypeError,5452#if PY_MAJOR_VERSION < 35453"%.200s() got an unexpected keyword argument '%.200s'",5454function_name, PyString_AsString(key));5455#else5456"%s() got an unexpected keyword argument '%U'",5457function_name, key);5458#endif5459bad:5460return -1;5461}54625463/* RaiseArgTupleInvalid */5464static void __Pyx_RaiseArgtupleInvalid(5465const char* func_name,5466int exact,5467Py_ssize_t num_min,5468Py_ssize_t num_max,5469Py_ssize_t num_found)5470{5471Py_ssize_t num_expected;5472const char *more_or_less;5473if (num_found < num_min) {5474num_expected = num_min;5475more_or_less = "at least";5476} else {5477num_expected = num_max;5478more_or_less = "at most";5479}5480if (exact) {5481more_or_less = "exactly";5482}5483PyErr_Format(PyExc_TypeError,5484"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",5485func_name, more_or_less, num_expected,5486(num_expected == 1) ? "" : "s", num_found);5487}54885489/* PyIntCompare */5490static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {5491if (op1 == op2) {5492Py_RETURN_TRUE;5493}5494#if PY_MAJOR_VERSION < 35495if (likely(PyInt_CheckExact(op1))) {5496const long b = intval;5497long a = PyInt_AS_LONG(op1);5498if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;5499}5500#endif5501#if CYTHON_USE_PYLONG_INTERNALS5502if (likely(PyLong_CheckExact(op1))) {5503int unequal;5504unsigned long uintval;5505Py_ssize_t size = Py_SIZE(op1);5506const digit* digits = ((PyLongObject*)op1)->ob_digit;5507if (intval == 0) {5508if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;5509} else if (intval < 0) {5510if (size >= 0)5511Py_RETURN_FALSE;5512intval = -intval;5513size = -size;5514} else {5515if (size <= 0)5516Py_RETURN_FALSE;5517}5518uintval = (unsigned long) intval;5519#if PyLong_SHIFT * 4 < SIZEOF_LONG*85520if (uintval >> (PyLong_SHIFT * 4)) {5521unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))5522| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));5523} else5524#endif5525#if PyLong_SHIFT * 3 < SIZEOF_LONG*85526if (uintval >> (PyLong_SHIFT * 3)) {5527unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))5528| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));5529} else5530#endif5531#if PyLong_SHIFT * 2 < SIZEOF_LONG*85532if (uintval >> (PyLong_SHIFT * 2)) {5533unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))5534| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));5535} else5536#endif5537#if PyLong_SHIFT * 1 < SIZEOF_LONG*85538if (uintval >> (PyLong_SHIFT * 1)) {5539unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))5540| (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));5541} else5542#endif5543unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));5544if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;5545}5546#endif5547if (PyFloat_CheckExact(op1)) {5548const long b = intval;5549double a = PyFloat_AS_DOUBLE(op1);5550if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;5551}5552return (5553PyObject_RichCompare(op1, op2, Py_EQ));5554}55555556/* PyDictVersioning */5557#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS5558static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {5559PyObject *dict = Py_TYPE(obj)->tp_dict;5560return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;5561}5562static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {5563PyObject **dictptr = NULL;5564Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;5565if (offset) {5566#if CYTHON_COMPILING_IN_CPYTHON5567dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);5568#else5569dictptr = _PyObject_GetDictPtr(obj);5570#endif5571}5572return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;5573}5574static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {5575PyObject *dict = Py_TYPE(obj)->tp_dict;5576if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))5577return 0;5578return obj_dict_version == __Pyx_get_object_dict_version(obj);5579}5580#endif55815582/* GetModuleGlobalName */5583#if CYTHON_USE_DICT_VERSIONS5584static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)5585#else5586static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)5587#endif5588{5589PyObject *result;5590#if !CYTHON_AVOID_BORROWED_REFS5591#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A15592result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);5593__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)5594if (likely(result)) {5595return __Pyx_NewRef(result);5596} else if (unlikely(PyErr_Occurred())) {5597return NULL;5598}5599#else5600result = PyDict_GetItem(__pyx_d, name);5601__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)5602if (likely(result)) {5603return __Pyx_NewRef(result);5604}5605#endif5606#else5607result = PyObject_GetItem(__pyx_d, name);5608__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)5609if (likely(result)) {5610return __Pyx_NewRef(result);5611}5612PyErr_Clear();5613#endif5614return __Pyx_GetBuiltinName(name);5615}56165617/* PyCFunctionFastCall */5618#if CYTHON_FAST_PYCCALL5619static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {5620PyCFunctionObject *func = (PyCFunctionObject*)func_obj;5621PyCFunction meth = PyCFunction_GET_FUNCTION(func);5622PyObject *self = PyCFunction_GET_SELF(func);5623int flags = PyCFunction_GET_FLAGS(func);5624assert(PyCFunction_Check(func));5625assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));5626assert(nargs >= 0);5627assert(nargs == 0 || args != NULL);5628/* _PyCFunction_FastCallDict() must not be called with an exception set,5629because it may clear it (directly or indirectly) and so the5630caller loses its exception */5631assert(!PyErr_Occurred());5632if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {5633return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);5634} else {5635return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);5636}5637}5638#endif56395640/* PyFunctionFastCall */5641#if CYTHON_FAST_PYCALL5642static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,5643PyObject *globals) {5644PyFrameObject *f;5645PyThreadState *tstate = __Pyx_PyThreadState_Current;5646PyObject **fastlocals;5647Py_ssize_t i;5648PyObject *result;5649assert(globals != NULL);5650/* XXX Perhaps we should create a specialized5651PyFrame_New() that doesn't take locals, but does5652take builtins without sanity checking them.5653*/5654assert(tstate != NULL);5655f = PyFrame_New(tstate, co, globals, NULL);5656if (f == NULL) {5657return NULL;5658}5659fastlocals = __Pyx_PyFrame_GetLocalsplus(f);5660for (i = 0; i < na; i++) {5661Py_INCREF(*args);5662fastlocals[i] = *args++;5663}5664result = PyEval_EvalFrameEx(f,0);5665++tstate->recursion_depth;5666Py_DECREF(f);5667--tstate->recursion_depth;5668return result;5669}5670#if 1 || PY_VERSION_HEX < 0x030600B15671static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {5672PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);5673PyObject *globals = PyFunction_GET_GLOBALS(func);5674PyObject *argdefs = PyFunction_GET_DEFAULTS(func);5675PyObject *closure;5676#if PY_MAJOR_VERSION >= 35677PyObject *kwdefs;5678#endif5679PyObject *kwtuple, **k;5680PyObject **d;5681Py_ssize_t nd;5682Py_ssize_t nk;5683PyObject *result;5684assert(kwargs == NULL || PyDict_Check(kwargs));5685nk = kwargs ? PyDict_Size(kwargs) : 0;5686if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {5687return NULL;5688}5689if (5690#if PY_MAJOR_VERSION >= 35691co->co_kwonlyargcount == 0 &&5692#endif5693likely(kwargs == NULL || nk == 0) &&5694co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {5695if (argdefs == NULL && co->co_argcount == nargs) {5696result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);5697goto done;5698}5699else if (nargs == 0 && argdefs != NULL5700&& co->co_argcount == Py_SIZE(argdefs)) {5701/* function called with no arguments, but all parameters have5702a default value: use default values as arguments .*/5703args = &PyTuple_GET_ITEM(argdefs, 0);5704result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);5705goto done;5706}5707}5708if (kwargs != NULL) {5709Py_ssize_t pos, i;5710kwtuple = PyTuple_New(2 * nk);5711if (kwtuple == NULL) {5712result = NULL;5713goto done;5714}5715k = &PyTuple_GET_ITEM(kwtuple, 0);5716pos = i = 0;5717while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {5718Py_INCREF(k[i]);5719Py_INCREF(k[i+1]);5720i += 2;5721}5722nk = i / 2;5723}5724else {5725kwtuple = NULL;5726k = NULL;5727}5728closure = PyFunction_GET_CLOSURE(func);5729#if PY_MAJOR_VERSION >= 35730kwdefs = PyFunction_GET_KW_DEFAULTS(func);5731#endif5732if (argdefs != NULL) {5733d = &PyTuple_GET_ITEM(argdefs, 0);5734nd = Py_SIZE(argdefs);5735}5736else {5737d = NULL;5738nd = 0;5739}5740#if PY_MAJOR_VERSION >= 35741result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,5742args, (int)nargs,5743k, (int)nk,5744d, (int)nd, kwdefs, closure);5745#else5746result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,5747args, (int)nargs,5748k, (int)nk,5749d, (int)nd, closure);5750#endif5751Py_XDECREF(kwtuple);5752done:5753Py_LeaveRecursiveCall();5754return result;5755}5756#endif5757#endif57585759/* PyObjectCall */5760#if CYTHON_COMPILING_IN_CPYTHON5761static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {5762PyObject *result;5763ternaryfunc call = Py_TYPE(func)->tp_call;5764if (unlikely(!call))5765return PyObject_Call(func, arg, kw);5766if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))5767return NULL;5768result = (*call)(func, arg, kw);5769Py_LeaveRecursiveCall();5770if (unlikely(!result) && unlikely(!PyErr_Occurred())) {5771PyErr_SetString(5772PyExc_SystemError,5773"NULL result without error in PyObject_Call");5774}5775return result;5776}5777#endif57785779/* PyObjectCall2Args */5780static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {5781PyObject *args, *result = NULL;5782#if CYTHON_FAST_PYCALL5783if (PyFunction_Check(function)) {5784PyObject *args[2] = {arg1, arg2};5785return __Pyx_PyFunction_FastCall(function, args, 2);5786}5787#endif5788#if CYTHON_FAST_PYCCALL5789if (__Pyx_PyFastCFunction_Check(function)) {5790PyObject *args[2] = {arg1, arg2};5791return __Pyx_PyCFunction_FastCall(function, args, 2);5792}5793#endif5794args = PyTuple_New(2);5795if (unlikely(!args)) goto done;5796Py_INCREF(arg1);5797PyTuple_SET_ITEM(args, 0, arg1);5798Py_INCREF(arg2);5799PyTuple_SET_ITEM(args, 1, arg2);5800Py_INCREF(function);5801result = __Pyx_PyObject_Call(function, args, NULL);5802Py_DECREF(args);5803Py_DECREF(function);5804done:5805return result;5806}58075808/* PyObjectCallMethO */5809#if CYTHON_COMPILING_IN_CPYTHON5810static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {5811PyObject *self, *result;5812PyCFunction cfunc;5813cfunc = PyCFunction_GET_FUNCTION(func);5814self = PyCFunction_GET_SELF(func);5815if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))5816return NULL;5817result = cfunc(self, arg);5818Py_LeaveRecursiveCall();5819if (unlikely(!result) && unlikely(!PyErr_Occurred())) {5820PyErr_SetString(5821PyExc_SystemError,5822"NULL result without error in PyObject_Call");5823}5824return result;5825}5826#endif58275828/* PyObjectCallOneArg */5829#if CYTHON_COMPILING_IN_CPYTHON5830static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {5831PyObject *result;5832PyObject *args = PyTuple_New(1);5833if (unlikely(!args)) return NULL;5834Py_INCREF(arg);5835PyTuple_SET_ITEM(args, 0, arg);5836result = __Pyx_PyObject_Call(func, args, NULL);5837Py_DECREF(args);5838return result;5839}5840static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {5841#if CYTHON_FAST_PYCALL5842if (PyFunction_Check(func)) {5843return __Pyx_PyFunction_FastCall(func, &arg, 1);5844}5845#endif5846if (likely(PyCFunction_Check(func))) {5847if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {5848return __Pyx_PyObject_CallMethO(func, arg);5849#if CYTHON_FAST_PYCCALL5850} else if (__Pyx_PyFastCFunction_Check(func)) {5851return __Pyx_PyCFunction_FastCall(func, &arg, 1);5852#endif5853}5854}5855return __Pyx__PyObject_CallOneArg(func, arg);5856}5857#else5858static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {5859PyObject *result;5860PyObject *args = PyTuple_Pack(1, arg);5861if (unlikely(!args)) return NULL;5862result = __Pyx_PyObject_Call(func, args, NULL);5863Py_DECREF(args);5864return result;5865}5866#endif58675868/* PyErrExceptionMatches */5869#if CYTHON_FAST_THREAD_STATE5870static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {5871Py_ssize_t i, n;5872n = PyTuple_GET_SIZE(tuple);5873#if PY_MAJOR_VERSION >= 35874for (i=0; i<n; i++) {5875if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;5876}5877#endif5878for (i=0; i<n; i++) {5879if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;5880}5881return 0;5882}5883static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {5884PyObject *exc_type = tstate->curexc_type;5885if (exc_type == err) return 1;5886if (unlikely(!exc_type)) return 0;5887if (unlikely(PyTuple_Check(err)))5888return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);5889return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);5890}5891#endif58925893/* PyErrFetchRestore */5894#if CYTHON_FAST_THREAD_STATE5895static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {5896PyObject *tmp_type, *tmp_value, *tmp_tb;5897tmp_type = tstate->curexc_type;5898tmp_value = tstate->curexc_value;5899tmp_tb = tstate->curexc_traceback;5900tstate->curexc_type = type;5901tstate->curexc_value = value;5902tstate->curexc_traceback = tb;5903Py_XDECREF(tmp_type);5904Py_XDECREF(tmp_value);5905Py_XDECREF(tmp_tb);5906}5907static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {5908*type = tstate->curexc_type;5909*value = tstate->curexc_value;5910*tb = tstate->curexc_traceback;5911tstate->curexc_type = 0;5912tstate->curexc_value = 0;5913tstate->curexc_traceback = 0;5914}5915#endif59165917/* GetAttr */5918static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {5919#if CYTHON_USE_TYPE_SLOTS5920#if PY_MAJOR_VERSION >= 35921if (likely(PyUnicode_Check(n)))5922#else5923if (likely(PyString_Check(n)))5924#endif5925return __Pyx_PyObject_GetAttrStr(o, n);5926#endif5927return PyObject_GetAttr(o, n);5928}59295930/* GetAttr3 */5931static PyObject *__Pyx_GetAttr3Default(PyObject *d) {5932__Pyx_PyThreadState_declare5933__Pyx_PyThreadState_assign5934if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))5935return NULL;5936__Pyx_PyErr_Clear();5937Py_INCREF(d);5938return d;5939}5940static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {5941PyObject *r = __Pyx_GetAttr(o, n);5942return (likely(r)) ? r : __Pyx_GetAttr3Default(d);5943}59445945/* None */5946static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {5947PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);5948}59495950/* PyObjectCallNoArg */5951#if CYTHON_COMPILING_IN_CPYTHON5952static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {5953#if CYTHON_FAST_PYCALL5954if (PyFunction_Check(func)) {5955return __Pyx_PyFunction_FastCall(func, NULL, 0);5956}5957#endif5958#ifdef __Pyx_CyFunction_USED5959if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))5960#else5961if (likely(PyCFunction_Check(func)))5962#endif5963{5964if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {5965return __Pyx_PyObject_CallMethO(func, NULL);5966}5967}5968return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);5969}5970#endif59715972/* PyIntBinop */5973#if !CYTHON_COMPILING_IN_PYPY5974static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {5975(void)inplace;5976(void)zerodivision_check;5977#if PY_MAJOR_VERSION < 35978if (likely(PyInt_CheckExact(op2))) {5979const long a = intval;5980long x;5981long b = PyInt_AS_LONG(op2);5982x = (long)((unsigned long)a + b);5983if (likely((x^a) >= 0 || (x^b) >= 0))5984return PyInt_FromLong(x);5985return PyLong_Type.tp_as_number->nb_add(op1, op2);5986}5987#endif5988#if CYTHON_USE_PYLONG_INTERNALS5989if (likely(PyLong_CheckExact(op2))) {5990const long a = intval;5991long b, x;5992#ifdef HAVE_LONG_LONG5993const PY_LONG_LONG lla = intval;5994PY_LONG_LONG llb, llx;5995#endif5996const digit* digits = ((PyLongObject*)op2)->ob_digit;5997const Py_ssize_t size = Py_SIZE(op2);5998if (likely(__Pyx_sst_abs(size) <= 1)) {5999b = likely(size) ? digits[0] : 0;6000if (size == -1) b = -b;6001} else {6002switch (size) {6003case -2:6004if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {6005b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));6006break;6007#ifdef HAVE_LONG_LONG6008} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {6009llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));6010goto long_long;6011#endif6012}6013CYTHON_FALLTHROUGH;6014case 2:6015if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {6016b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));6017break;6018#ifdef HAVE_LONG_LONG6019} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {6020llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));6021goto long_long;6022#endif6023}6024CYTHON_FALLTHROUGH;6025case -3:6026if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {6027b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));6028break;6029#ifdef HAVE_LONG_LONG6030} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {6031llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));6032goto long_long;6033#endif6034}6035CYTHON_FALLTHROUGH;6036case 3:6037if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {6038b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));6039break;6040#ifdef HAVE_LONG_LONG6041} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {6042llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));6043goto long_long;6044#endif6045}6046CYTHON_FALLTHROUGH;6047case -4:6048if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {6049b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));6050break;6051#ifdef HAVE_LONG_LONG6052} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {6053llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));6054goto long_long;6055#endif6056}6057CYTHON_FALLTHROUGH;6058case 4:6059if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {6060b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));6061break;6062#ifdef HAVE_LONG_LONG6063} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {6064llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));6065goto long_long;6066#endif6067}6068CYTHON_FALLTHROUGH;6069default: return PyLong_Type.tp_as_number->nb_add(op1, op2);6070}6071}6072x = a + b;6073return PyLong_FromLong(x);6074#ifdef HAVE_LONG_LONG6075long_long:6076llx = lla + llb;6077return PyLong_FromLongLong(llx);6078#endif607960806081}6082#endif6083if (PyFloat_CheckExact(op2)) {6084const long a = intval;6085double b = PyFloat_AS_DOUBLE(op2);6086double result;6087PyFPE_START_PROTECT("add", return NULL)6088result = ((double)a) + (double)b;6089PyFPE_END_PROTECT(result)6090return PyFloat_FromDouble(result);6091}6092return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);6093}6094#endif60956096/* GetItemInt */6097static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {6098PyObject *r;6099if (!j) return NULL;6100r = PyObject_GetItem(o, j);6101Py_DECREF(j);6102return r;6103}6104static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,6105CYTHON_NCP_UNUSED int wraparound,6106CYTHON_NCP_UNUSED int boundscheck) {6107#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS6108Py_ssize_t wrapped_i = i;6109if (wraparound & unlikely(i < 0)) {6110wrapped_i += PyList_GET_SIZE(o);6111}6112if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {6113PyObject *r = PyList_GET_ITEM(o, wrapped_i);6114Py_INCREF(r);6115return r;6116}6117return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));6118#else6119return PySequence_GetItem(o, i);6120#endif6121}6122static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,6123CYTHON_NCP_UNUSED int wraparound,6124CYTHON_NCP_UNUSED int boundscheck) {6125#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS6126Py_ssize_t wrapped_i = i;6127if (wraparound & unlikely(i < 0)) {6128wrapped_i += PyTuple_GET_SIZE(o);6129}6130if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {6131PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);6132Py_INCREF(r);6133return r;6134}6135return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));6136#else6137return PySequence_GetItem(o, i);6138#endif6139}6140static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,6141CYTHON_NCP_UNUSED int wraparound,6142CYTHON_NCP_UNUSED int boundscheck) {6143#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS6144if (is_list || PyList_CheckExact(o)) {6145Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);6146if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {6147PyObject *r = PyList_GET_ITEM(o, n);6148Py_INCREF(r);6149return r;6150}6151}6152else if (PyTuple_CheckExact(o)) {6153Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);6154if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {6155PyObject *r = PyTuple_GET_ITEM(o, n);6156Py_INCREF(r);6157return r;6158}6159} else {6160PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;6161if (likely(m && m->sq_item)) {6162if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {6163Py_ssize_t l = m->sq_length(o);6164if (likely(l >= 0)) {6165i += l;6166} else {6167if (!PyErr_ExceptionMatches(PyExc_OverflowError))6168return NULL;6169PyErr_Clear();6170}6171}6172return m->sq_item(o, i);6173}6174}6175#else6176if (is_list || PySequence_Check(o)) {6177return PySequence_GetItem(o, i);6178}6179#endif6180return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));6181}61826183/* Import */6184static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {6185PyObject *empty_list = 0;6186PyObject *module = 0;6187PyObject *global_dict = 0;6188PyObject *empty_dict = 0;6189PyObject *list;6190#if PY_MAJOR_VERSION < 36191PyObject *py_import;6192py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);6193if (!py_import)6194goto bad;6195#endif6196if (from_list)6197list = from_list;6198else {6199empty_list = PyList_New(0);6200if (!empty_list)6201goto bad;6202list = empty_list;6203}6204global_dict = PyModule_GetDict(__pyx_m);6205if (!global_dict)6206goto bad;6207empty_dict = PyDict_New();6208if (!empty_dict)6209goto bad;6210{6211#if PY_MAJOR_VERSION >= 36212if (level == -1) {6213if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {6214module = PyImport_ImportModuleLevelObject(6215name, global_dict, empty_dict, list, 1);6216if (!module) {6217if (!PyErr_ExceptionMatches(PyExc_ImportError))6218goto bad;6219PyErr_Clear();6220}6221}6222level = 0;6223}6224#endif6225if (!module) {6226#if PY_MAJOR_VERSION < 36227PyObject *py_level = PyInt_FromLong(level);6228if (!py_level)6229goto bad;6230module = PyObject_CallFunctionObjArgs(py_import,6231name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);6232Py_DECREF(py_level);6233#else6234module = PyImport_ImportModuleLevelObject(6235name, global_dict, empty_dict, list, level);6236#endif6237}6238}6239bad:6240#if PY_MAJOR_VERSION < 36241Py_XDECREF(py_import);6242#endif6243Py_XDECREF(empty_list);6244Py_XDECREF(empty_dict);6245return module;6246}62476248/* ImportFrom */6249static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {6250PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);6251if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {6252PyErr_Format(PyExc_ImportError,6253#if PY_MAJOR_VERSION < 36254"cannot import name %.230s", PyString_AS_STRING(name));6255#else6256"cannot import name %S", name);6257#endif6258}6259return value;6260}62616262/* RaiseException */6263#if PY_MAJOR_VERSION < 36264static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,6265CYTHON_UNUSED PyObject *cause) {6266__Pyx_PyThreadState_declare6267Py_XINCREF(type);6268if (!value || value == Py_None)6269value = NULL;6270else6271Py_INCREF(value);6272if (!tb || tb == Py_None)6273tb = NULL;6274else {6275Py_INCREF(tb);6276if (!PyTraceBack_Check(tb)) {6277PyErr_SetString(PyExc_TypeError,6278"raise: arg 3 must be a traceback or None");6279goto raise_error;6280}6281}6282if (PyType_Check(type)) {6283#if CYTHON_COMPILING_IN_PYPY6284if (!value) {6285Py_INCREF(Py_None);6286value = Py_None;6287}6288#endif6289PyErr_NormalizeException(&type, &value, &tb);6290} else {6291if (value) {6292PyErr_SetString(PyExc_TypeError,6293"instance exception may not have a separate value");6294goto raise_error;6295}6296value = type;6297type = (PyObject*) Py_TYPE(type);6298Py_INCREF(type);6299if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {6300PyErr_SetString(PyExc_TypeError,6301"raise: exception class must be a subclass of BaseException");6302goto raise_error;6303}6304}6305__Pyx_PyThreadState_assign6306__Pyx_ErrRestore(type, value, tb);6307return;6308raise_error:6309Py_XDECREF(value);6310Py_XDECREF(type);6311Py_XDECREF(tb);6312return;6313}6314#else6315static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {6316PyObject* owned_instance = NULL;6317if (tb == Py_None) {6318tb = 0;6319} else if (tb && !PyTraceBack_Check(tb)) {6320PyErr_SetString(PyExc_TypeError,6321"raise: arg 3 must be a traceback or None");6322goto bad;6323}6324if (value == Py_None)6325value = 0;6326if (PyExceptionInstance_Check(type)) {6327if (value) {6328PyErr_SetString(PyExc_TypeError,6329"instance exception may not have a separate value");6330goto bad;6331}6332value = type;6333type = (PyObject*) Py_TYPE(value);6334} else if (PyExceptionClass_Check(type)) {6335PyObject *instance_class = NULL;6336if (value && PyExceptionInstance_Check(value)) {6337instance_class = (PyObject*) Py_TYPE(value);6338if (instance_class != type) {6339int is_subclass = PyObject_IsSubclass(instance_class, type);6340if (!is_subclass) {6341instance_class = NULL;6342} else if (unlikely(is_subclass == -1)) {6343goto bad;6344} else {6345type = instance_class;6346}6347}6348}6349if (!instance_class) {6350PyObject *args;6351if (!value)6352args = PyTuple_New(0);6353else if (PyTuple_Check(value)) {6354Py_INCREF(value);6355args = value;6356} else6357args = PyTuple_Pack(1, value);6358if (!args)6359goto bad;6360owned_instance = PyObject_Call(type, args, NULL);6361Py_DECREF(args);6362if (!owned_instance)6363goto bad;6364value = owned_instance;6365if (!PyExceptionInstance_Check(value)) {6366PyErr_Format(PyExc_TypeError,6367"calling %R should have returned an instance of "6368"BaseException, not %R",6369type, Py_TYPE(value));6370goto bad;6371}6372}6373} else {6374PyErr_SetString(PyExc_TypeError,6375"raise: exception class must be a subclass of BaseException");6376goto bad;6377}6378if (cause) {6379PyObject *fixed_cause;6380if (cause == Py_None) {6381fixed_cause = NULL;6382} else if (PyExceptionClass_Check(cause)) {6383fixed_cause = PyObject_CallObject(cause, NULL);6384if (fixed_cause == NULL)6385goto bad;6386} else if (PyExceptionInstance_Check(cause)) {6387fixed_cause = cause;6388Py_INCREF(fixed_cause);6389} else {6390PyErr_SetString(PyExc_TypeError,6391"exception causes must derive from "6392"BaseException");6393goto bad;6394}6395PyException_SetCause(value, fixed_cause);6396}6397PyErr_SetObject(type, value);6398if (tb) {6399#if CYTHON_COMPILING_IN_PYPY6400PyObject *tmp_type, *tmp_value, *tmp_tb;6401PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);6402Py_INCREF(tb);6403PyErr_Restore(tmp_type, tmp_value, tb);6404Py_XDECREF(tmp_tb);6405#else6406PyThreadState *tstate = __Pyx_PyThreadState_Current;6407PyObject* tmp_tb = tstate->curexc_traceback;6408if (tb != tmp_tb) {6409Py_INCREF(tb);6410tstate->curexc_traceback = tb;6411Py_XDECREF(tmp_tb);6412}6413#endif6414}6415bad:6416Py_XDECREF(owned_instance);6417return;6418}6419#endif64206421/* HasAttr */6422static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {6423PyObject *r;6424if (unlikely(!__Pyx_PyBaseString_Check(n))) {6425PyErr_SetString(PyExc_TypeError,6426"hasattr(): attribute name must be string");6427return -1;6428}6429r = __Pyx_GetAttr(o, n);6430if (unlikely(!r)) {6431PyErr_Clear();6432return 0;6433} else {6434Py_DECREF(r);6435return 1;6436}6437}64386439/* PyObject_GenericGetAttrNoDict */6440#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x030700006441static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {6442PyErr_Format(PyExc_AttributeError,6443#if PY_MAJOR_VERSION >= 36444"'%.50s' object has no attribute '%U'",6445tp->tp_name, attr_name);6446#else6447"'%.50s' object has no attribute '%.400s'",6448tp->tp_name, PyString_AS_STRING(attr_name));6449#endif6450return NULL;6451}6452static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {6453PyObject *descr;6454PyTypeObject *tp = Py_TYPE(obj);6455if (unlikely(!PyString_Check(attr_name))) {6456return PyObject_GenericGetAttr(obj, attr_name);6457}6458assert(!tp->tp_dictoffset);6459descr = _PyType_Lookup(tp, attr_name);6460if (unlikely(!descr)) {6461return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);6462}6463Py_INCREF(descr);6464#if PY_MAJOR_VERSION < 36465if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))6466#endif6467{6468descrgetfunc f = Py_TYPE(descr)->tp_descr_get;6469if (unlikely(f)) {6470PyObject *res = f(descr, obj, (PyObject *)tp);6471Py_DECREF(descr);6472return res;6473}6474}6475return descr;6476}6477#endif64786479/* PyObject_GenericGetAttr */6480#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x030700006481static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {6482if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {6483return PyObject_GenericGetAttr(obj, attr_name);6484}6485return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);6486}6487#endif64886489/* PyObjectGetAttrStrNoError */6490static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {6491__Pyx_PyThreadState_declare6492__Pyx_PyThreadState_assign6493if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))6494__Pyx_PyErr_Clear();6495}6496static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {6497PyObject *result;6498#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B16499PyTypeObject* tp = Py_TYPE(obj);6500if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {6501return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);6502}6503#endif6504result = __Pyx_PyObject_GetAttrStr(obj, attr_name);6505if (unlikely(!result)) {6506__Pyx_PyObject_GetAttrStr_ClearAttributeError();6507}6508return result;6509}65106511/* SetupReduce */6512static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {6513int ret;6514PyObject *name_attr;6515name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);6516if (likely(name_attr)) {6517ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);6518} else {6519ret = -1;6520}6521if (unlikely(ret < 0)) {6522PyErr_Clear();6523ret = 0;6524}6525Py_XDECREF(name_attr);6526return ret;6527}6528static int __Pyx_setup_reduce(PyObject* type_obj) {6529int ret = 0;6530PyObject *object_reduce = NULL;6531PyObject *object_getstate = NULL;6532PyObject *object_reduce_ex = NULL;6533PyObject *reduce = NULL;6534PyObject *reduce_ex = NULL;6535PyObject *reduce_cython = NULL;6536PyObject *setstate = NULL;6537PyObject *setstate_cython = NULL;6538PyObject *getstate = NULL;6539#if CYTHON_USE_PYTYPE_LOOKUP6540getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);6541#else6542getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);6543if (!getstate && PyErr_Occurred()) {6544goto __PYX_BAD;6545}6546#endif6547if (getstate) {6548#if CYTHON_USE_PYTYPE_LOOKUP6549object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);6550#else6551object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);6552if (!object_getstate && PyErr_Occurred()) {6553goto __PYX_BAD;6554}6555#endif6556if (object_getstate != getstate) {6557goto __PYX_GOOD;6558}6559}6560#if CYTHON_USE_PYTYPE_LOOKUP6561object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;6562#else6563object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;6564#endif6565reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;6566if (reduce_ex == object_reduce_ex) {6567#if CYTHON_USE_PYTYPE_LOOKUP6568object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;6569#else6570object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;6571#endif6572reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;6573if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {6574reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);6575if (likely(reduce_cython)) {6576ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;6577ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;6578} else if (reduce == object_reduce || PyErr_Occurred()) {6579goto __PYX_BAD;6580}6581setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);6582if (!setstate) PyErr_Clear();6583if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {6584setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);6585if (likely(setstate_cython)) {6586ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;6587ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;6588} else if (!setstate || PyErr_Occurred()) {6589goto __PYX_BAD;6590}6591}6592PyType_Modified((PyTypeObject*)type_obj);6593}6594}6595goto __PYX_GOOD;6596__PYX_BAD:6597if (!PyErr_Occurred())6598PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);6599ret = -1;6600__PYX_GOOD:6601#if !CYTHON_USE_PYTYPE_LOOKUP6602Py_XDECREF(object_reduce);6603Py_XDECREF(object_reduce_ex);6604Py_XDECREF(object_getstate);6605Py_XDECREF(getstate);6606#endif6607Py_XDECREF(reduce);6608Py_XDECREF(reduce_ex);6609Py_XDECREF(reduce_cython);6610Py_XDECREF(setstate);6611Py_XDECREF(setstate_cython);6612return ret;6613}66146615/* BytesEquals */6616static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {6617#if CYTHON_COMPILING_IN_PYPY6618return PyObject_RichCompareBool(s1, s2, equals);6619#else6620if (s1 == s2) {6621return (equals == Py_EQ);6622} else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {6623const char *ps1, *ps2;6624Py_ssize_t length = PyBytes_GET_SIZE(s1);6625if (length != PyBytes_GET_SIZE(s2))6626return (equals == Py_NE);6627ps1 = PyBytes_AS_STRING(s1);6628ps2 = PyBytes_AS_STRING(s2);6629if (ps1[0] != ps2[0]) {6630return (equals == Py_NE);6631} else if (length == 1) {6632return (equals == Py_EQ);6633} else {6634int result;6635#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)6636Py_hash_t hash1, hash2;6637hash1 = ((PyBytesObject*)s1)->ob_shash;6638hash2 = ((PyBytesObject*)s2)->ob_shash;6639if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {6640return (equals == Py_NE);6641}6642#endif6643result = memcmp(ps1, ps2, (size_t)length);6644return (equals == Py_EQ) ? (result == 0) : (result != 0);6645}6646} else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {6647return (equals == Py_NE);6648} else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {6649return (equals == Py_NE);6650} else {6651int result;6652PyObject* py_result = PyObject_RichCompare(s1, s2, equals);6653if (!py_result)6654return -1;6655result = __Pyx_PyObject_IsTrue(py_result);6656Py_DECREF(py_result);6657return result;6658}6659#endif6660}66616662/* UnicodeEquals */6663static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {6664#if CYTHON_COMPILING_IN_PYPY6665return PyObject_RichCompareBool(s1, s2, equals);6666#else6667#if PY_MAJOR_VERSION < 36668PyObject* owned_ref = NULL;6669#endif6670int s1_is_unicode, s2_is_unicode;6671if (s1 == s2) {6672goto return_eq;6673}6674s1_is_unicode = PyUnicode_CheckExact(s1);6675s2_is_unicode = PyUnicode_CheckExact(s2);6676#if PY_MAJOR_VERSION < 36677if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {6678owned_ref = PyUnicode_FromObject(s2);6679if (unlikely(!owned_ref))6680return -1;6681s2 = owned_ref;6682s2_is_unicode = 1;6683} else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {6684owned_ref = PyUnicode_FromObject(s1);6685if (unlikely(!owned_ref))6686return -1;6687s1 = owned_ref;6688s1_is_unicode = 1;6689} else if (((!s2_is_unicode) & (!s1_is_unicode))) {6690return __Pyx_PyBytes_Equals(s1, s2, equals);6691}6692#endif6693if (s1_is_unicode & s2_is_unicode) {6694Py_ssize_t length;6695int kind;6696void *data1, *data2;6697if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))6698return -1;6699length = __Pyx_PyUnicode_GET_LENGTH(s1);6700if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {6701goto return_ne;6702}6703#if CYTHON_USE_UNICODE_INTERNALS6704{6705Py_hash_t hash1, hash2;6706#if CYTHON_PEP393_ENABLED6707hash1 = ((PyASCIIObject*)s1)->hash;6708hash2 = ((PyASCIIObject*)s2)->hash;6709#else6710hash1 = ((PyUnicodeObject*)s1)->hash;6711hash2 = ((PyUnicodeObject*)s2)->hash;6712#endif6713if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {6714goto return_ne;6715}6716}6717#endif6718kind = __Pyx_PyUnicode_KIND(s1);6719if (kind != __Pyx_PyUnicode_KIND(s2)) {6720goto return_ne;6721}6722data1 = __Pyx_PyUnicode_DATA(s1);6723data2 = __Pyx_PyUnicode_DATA(s2);6724if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {6725goto return_ne;6726} else if (length == 1) {6727goto return_eq;6728} else {6729int result = memcmp(data1, data2, (size_t)(length * kind));6730#if PY_MAJOR_VERSION < 36731Py_XDECREF(owned_ref);6732#endif6733return (equals == Py_EQ) ? (result == 0) : (result != 0);6734}6735} else if ((s1 == Py_None) & s2_is_unicode) {6736goto return_ne;6737} else if ((s2 == Py_None) & s1_is_unicode) {6738goto return_ne;6739} else {6740int result;6741PyObject* py_result = PyObject_RichCompare(s1, s2, equals);6742#if PY_MAJOR_VERSION < 36743Py_XDECREF(owned_ref);6744#endif6745if (!py_result)6746return -1;6747result = __Pyx_PyObject_IsTrue(py_result);6748Py_DECREF(py_result);6749return result;6750}6751return_eq:6752#if PY_MAJOR_VERSION < 36753Py_XDECREF(owned_ref);6754#endif6755return (equals == Py_EQ);6756return_ne:6757#if PY_MAJOR_VERSION < 36758Py_XDECREF(owned_ref);6759#endif6760return (equals == Py_NE);6761#endif6762}67636764/* CLineInTraceback */6765#ifndef CYTHON_CLINE_IN_TRACEBACK6766static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {6767PyObject *use_cline;6768PyObject *ptype, *pvalue, *ptraceback;6769#if CYTHON_COMPILING_IN_CPYTHON6770PyObject **cython_runtime_dict;6771#endif6772if (unlikely(!__pyx_cython_runtime)) {6773return c_line;6774}6775__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);6776#if CYTHON_COMPILING_IN_CPYTHON6777cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);6778if (likely(cython_runtime_dict)) {6779__PYX_PY_DICT_LOOKUP_IF_MODIFIED(6780use_cline, *cython_runtime_dict,6781__Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))6782} else6783#endif6784{6785PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);6786if (use_cline_obj) {6787use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;6788Py_DECREF(use_cline_obj);6789} else {6790PyErr_Clear();6791use_cline = NULL;6792}6793}6794if (!use_cline) {6795c_line = 0;6796(void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);6797}6798else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {6799c_line = 0;6800}6801__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);6802return c_line;6803}6804#endif68056806/* CodeObjectCache */6807static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {6808int start = 0, mid = 0, end = count - 1;6809if (end >= 0 && code_line > entries[end].code_line) {6810return count;6811}6812while (start < end) {6813mid = start + (end - start) / 2;6814if (code_line < entries[mid].code_line) {6815end = mid;6816} else if (code_line > entries[mid].code_line) {6817start = mid + 1;6818} else {6819return mid;6820}6821}6822if (code_line <= entries[mid].code_line) {6823return mid;6824} else {6825return mid + 1;6826}6827}6828static PyCodeObject *__pyx_find_code_object(int code_line) {6829PyCodeObject* code_object;6830int pos;6831if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {6832return NULL;6833}6834pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);6835if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {6836return NULL;6837}6838code_object = __pyx_code_cache.entries[pos].code_object;6839Py_INCREF(code_object);6840return code_object;6841}6842static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {6843int pos, i;6844__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;6845if (unlikely(!code_line)) {6846return;6847}6848if (unlikely(!entries)) {6849entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));6850if (likely(entries)) {6851__pyx_code_cache.entries = entries;6852__pyx_code_cache.max_count = 64;6853__pyx_code_cache.count = 1;6854entries[0].code_line = code_line;6855entries[0].code_object = code_object;6856Py_INCREF(code_object);6857}6858return;6859}6860pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);6861if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {6862PyCodeObject* tmp = entries[pos].code_object;6863entries[pos].code_object = code_object;6864Py_DECREF(tmp);6865return;6866}6867if (__pyx_code_cache.count == __pyx_code_cache.max_count) {6868int new_max = __pyx_code_cache.max_count + 64;6869entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(6870__pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));6871if (unlikely(!entries)) {6872return;6873}6874__pyx_code_cache.entries = entries;6875__pyx_code_cache.max_count = new_max;6876}6877for (i=__pyx_code_cache.count; i>pos; i--) {6878entries[i] = entries[i-1];6879}6880entries[pos].code_line = code_line;6881entries[pos].code_object = code_object;6882__pyx_code_cache.count++;6883Py_INCREF(code_object);6884}68856886/* AddTraceback */6887#include "compile.h"6888#include "frameobject.h"6889#include "traceback.h"6890#if PY_VERSION_HEX >= 0x030b00a66891#ifndef Py_BUILD_CORE6892#define Py_BUILD_CORE 16893#endif6894#include "internal/pycore_frame.h"6895#endif6896static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(6897const char *funcname, int c_line,6898int py_line, const char *filename) {6899PyCodeObject *py_code = NULL;6900PyObject *py_funcname = NULL;6901#if PY_MAJOR_VERSION < 36902PyObject *py_srcfile = NULL;6903py_srcfile = PyString_FromString(filename);6904if (!py_srcfile) goto bad;6905#endif6906if (c_line) {6907#if PY_MAJOR_VERSION < 36908py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);6909if (!py_funcname) goto bad;6910#else6911py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);6912if (!py_funcname) goto bad;6913funcname = PyUnicode_AsUTF8(py_funcname);6914if (!funcname) goto bad;6915#endif6916}6917else {6918#if PY_MAJOR_VERSION < 36919py_funcname = PyString_FromString(funcname);6920if (!py_funcname) goto bad;6921#endif6922}6923#if PY_MAJOR_VERSION < 36924py_code = __Pyx_PyCode_New(69250,69260,69270,69280,69290,6930__pyx_empty_bytes, /*PyObject *code,*/6931__pyx_empty_tuple, /*PyObject *consts,*/6932__pyx_empty_tuple, /*PyObject *names,*/6933__pyx_empty_tuple, /*PyObject *varnames,*/6934__pyx_empty_tuple, /*PyObject *freevars,*/6935__pyx_empty_tuple, /*PyObject *cellvars,*/6936py_srcfile, /*PyObject *filename,*/6937py_funcname, /*PyObject *name,*/6938py_line,6939__pyx_empty_bytes /*PyObject *lnotab*/6940);6941Py_DECREF(py_srcfile);6942#else6943py_code = PyCode_NewEmpty(filename, funcname, py_line);6944#endif6945Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline6946return py_code;6947bad:6948Py_XDECREF(py_funcname);6949#if PY_MAJOR_VERSION < 36950Py_XDECREF(py_srcfile);6951#endif6952return NULL;6953}6954static void __Pyx_AddTraceback(const char *funcname, int c_line,6955int py_line, const char *filename) {6956PyCodeObject *py_code = 0;6957PyFrameObject *py_frame = 0;6958PyThreadState *tstate = __Pyx_PyThreadState_Current;6959PyObject *ptype, *pvalue, *ptraceback;6960if (c_line) {6961c_line = __Pyx_CLineForTraceback(tstate, c_line);6962}6963py_code = __pyx_find_code_object(c_line ? -c_line : py_line);6964if (!py_code) {6965__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);6966py_code = __Pyx_CreateCodeObjectForTraceback(6967funcname, c_line, py_line, filename);6968if (!py_code) {6969/* If the code object creation fails, then we should clear the6970fetched exception references and propagate the new exception */6971Py_XDECREF(ptype);6972Py_XDECREF(pvalue);6973Py_XDECREF(ptraceback);6974goto bad;6975}6976__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);6977__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);6978}6979py_frame = PyFrame_New(6980tstate, /*PyThreadState *tstate,*/6981py_code, /*PyCodeObject *code,*/6982__pyx_d, /*PyObject *globals,*/69830 /*PyObject *locals*/6984);6985if (!py_frame) goto bad;6986__Pyx_PyFrame_SetLineNumber(py_frame, py_line);6987PyTraceBack_Here(py_frame);6988bad:6989Py_XDECREF(py_code);6990Py_XDECREF(py_frame);6991}69926993/* CIntFromPyVerify */6994#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\6995__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)6996#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\6997__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)6998#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\6999{\7000func_type value = func_value;\7001if (sizeof(target_type) < sizeof(func_type)) {\7002if (unlikely(value != (func_type) (target_type) value)) {\7003func_type zero = 0;\7004if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\7005return (target_type) -1;\7006if (is_unsigned && unlikely(value < zero))\7007goto raise_neg_overflow;\7008else\7009goto raise_overflow;\7010}\7011}\7012return (target_type) value;\7013}70147015/* CIntToPy */7016static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {7017#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7018#pragma GCC diagnostic push7019#pragma GCC diagnostic ignored "-Wconversion"7020#endif7021const int neg_one = (int) -1, const_zero = (int) 0;7022#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7023#pragma GCC diagnostic pop7024#endif7025const int is_unsigned = neg_one > const_zero;7026if (is_unsigned) {7027if (sizeof(int) < sizeof(long)) {7028return PyInt_FromLong((long) value);7029} else if (sizeof(int) <= sizeof(unsigned long)) {7030return PyLong_FromUnsignedLong((unsigned long) value);7031#ifdef HAVE_LONG_LONG7032} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {7033return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);7034#endif7035}7036} else {7037if (sizeof(int) <= sizeof(long)) {7038return PyInt_FromLong((long) value);7039#ifdef HAVE_LONG_LONG7040} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {7041return PyLong_FromLongLong((PY_LONG_LONG) value);7042#endif7043}7044}7045{7046int one = 1; int little = (int)*(unsigned char *)&one;7047unsigned char *bytes = (unsigned char *)&value;7048return _PyLong_FromByteArray(bytes, sizeof(int),7049little, !is_unsigned);7050}7051}70527053/* CIntFromPy */7054static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {7055#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7056#pragma GCC diagnostic push7057#pragma GCC diagnostic ignored "-Wconversion"7058#endif7059const int neg_one = (int) -1, const_zero = (int) 0;7060#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7061#pragma GCC diagnostic pop7062#endif7063const int is_unsigned = neg_one > const_zero;7064#if PY_MAJOR_VERSION < 37065if (likely(PyInt_Check(x))) {7066if (sizeof(int) < sizeof(long)) {7067__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))7068} else {7069long val = PyInt_AS_LONG(x);7070if (is_unsigned && unlikely(val < 0)) {7071goto raise_neg_overflow;7072}7073return (int) val;7074}7075} else7076#endif7077if (likely(PyLong_Check(x))) {7078if (is_unsigned) {7079#if CYTHON_USE_PYLONG_INTERNALS7080const digit* digits = ((PyLongObject*)x)->ob_digit;7081switch (Py_SIZE(x)) {7082case 0: return (int) 0;7083case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])7084case 2:7085if (8 * sizeof(int) > 1 * PyLong_SHIFT) {7086if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7087__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7088} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {7089return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));7090}7091}7092break;7093case 3:7094if (8 * sizeof(int) > 2 * PyLong_SHIFT) {7095if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7096__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7097} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {7098return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));7099}7100}7101break;7102case 4:7103if (8 * sizeof(int) > 3 * PyLong_SHIFT) {7104if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7105__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7106} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {7107return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));7108}7109}7110break;7111}7112#endif7113#if CYTHON_COMPILING_IN_CPYTHON7114if (unlikely(Py_SIZE(x) < 0)) {7115goto raise_neg_overflow;7116}7117#else7118{7119int result = PyObject_RichCompareBool(x, Py_False, Py_LT);7120if (unlikely(result < 0))7121return (int) -1;7122if (unlikely(result == 1))7123goto raise_neg_overflow;7124}7125#endif7126if (sizeof(int) <= sizeof(unsigned long)) {7127__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))7128#ifdef HAVE_LONG_LONG7129} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {7130__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))7131#endif7132}7133} else {7134#if CYTHON_USE_PYLONG_INTERNALS7135const digit* digits = ((PyLongObject*)x)->ob_digit;7136switch (Py_SIZE(x)) {7137case 0: return (int) 0;7138case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))7139case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])7140case -2:7141if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {7142if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7143__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7144} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {7145return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));7146}7147}7148break;7149case 2:7150if (8 * sizeof(int) > 1 * PyLong_SHIFT) {7151if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7152__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7153} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {7154return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));7155}7156}7157break;7158case -3:7159if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {7160if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7161__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7162} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {7163return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));7164}7165}7166break;7167case 3:7168if (8 * sizeof(int) > 2 * PyLong_SHIFT) {7169if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7170__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7171} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {7172return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));7173}7174}7175break;7176case -4:7177if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {7178if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7179__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7180} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {7181return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));7182}7183}7184break;7185case 4:7186if (8 * sizeof(int) > 3 * PyLong_SHIFT) {7187if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7188__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7189} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {7190return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));7191}7192}7193break;7194}7195#endif7196if (sizeof(int) <= sizeof(long)) {7197__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))7198#ifdef HAVE_LONG_LONG7199} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {7200__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))7201#endif7202}7203}7204{7205#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)7206PyErr_SetString(PyExc_RuntimeError,7207"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");7208#else7209int val;7210PyObject *v = __Pyx_PyNumber_IntOrLong(x);7211#if PY_MAJOR_VERSION < 37212if (likely(v) && !PyLong_Check(v)) {7213PyObject *tmp = v;7214v = PyNumber_Long(tmp);7215Py_DECREF(tmp);7216}7217#endif7218if (likely(v)) {7219int one = 1; int is_little = (int)*(unsigned char *)&one;7220unsigned char *bytes = (unsigned char *)&val;7221int ret = _PyLong_AsByteArray((PyLongObject *)v,7222bytes, sizeof(val),7223is_little, !is_unsigned);7224Py_DECREF(v);7225if (likely(!ret))7226return val;7227}7228#endif7229return (int) -1;7230}7231} else {7232int val;7233PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);7234if (!tmp) return (int) -1;7235val = __Pyx_PyInt_As_int(tmp);7236Py_DECREF(tmp);7237return val;7238}7239raise_overflow:7240PyErr_SetString(PyExc_OverflowError,7241"value too large to convert to int");7242return (int) -1;7243raise_neg_overflow:7244PyErr_SetString(PyExc_OverflowError,7245"can't convert negative value to int");7246return (int) -1;7247}72487249/* CIntFromPy */7250static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {7251#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7252#pragma GCC diagnostic push7253#pragma GCC diagnostic ignored "-Wconversion"7254#endif7255const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;7256#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7257#pragma GCC diagnostic pop7258#endif7259const int is_unsigned = neg_one > const_zero;7260#if PY_MAJOR_VERSION < 37261if (likely(PyInt_Check(x))) {7262if (sizeof(PY_LONG_LONG) < sizeof(long)) {7263__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))7264} else {7265long val = PyInt_AS_LONG(x);7266if (is_unsigned && unlikely(val < 0)) {7267goto raise_neg_overflow;7268}7269return (PY_LONG_LONG) val;7270}7271} else7272#endif7273if (likely(PyLong_Check(x))) {7274if (is_unsigned) {7275#if CYTHON_USE_PYLONG_INTERNALS7276const digit* digits = ((PyLongObject*)x)->ob_digit;7277switch (Py_SIZE(x)) {7278case 0: return (PY_LONG_LONG) 0;7279case 1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])7280case 2:7281if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {7282if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7283__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7284} else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {7285return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));7286}7287}7288break;7289case 3:7290if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {7291if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7292__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7293} else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {7294return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));7295}7296}7297break;7298case 4:7299if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {7300if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7301__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7302} else if (8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {7303return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));7304}7305}7306break;7307}7308#endif7309#if CYTHON_COMPILING_IN_CPYTHON7310if (unlikely(Py_SIZE(x) < 0)) {7311goto raise_neg_overflow;7312}7313#else7314{7315int result = PyObject_RichCompareBool(x, Py_False, Py_LT);7316if (unlikely(result < 0))7317return (PY_LONG_LONG) -1;7318if (unlikely(result == 1))7319goto raise_neg_overflow;7320}7321#endif7322if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {7323__PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))7324#ifdef HAVE_LONG_LONG7325} else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {7326__PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))7327#endif7328}7329} else {7330#if CYTHON_USE_PYLONG_INTERNALS7331const digit* digits = ((PyLongObject*)x)->ob_digit;7332switch (Py_SIZE(x)) {7333case 0: return (PY_LONG_LONG) 0;7334case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))7335case 1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, +digits[0])7336case -2:7337if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {7338if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7339__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7340} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {7341return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));7342}7343}7344break;7345case 2:7346if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {7347if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7348__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7349} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {7350return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));7351}7352}7353break;7354case -3:7355if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {7356if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7357__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7358} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {7359return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));7360}7361}7362break;7363case 3:7364if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {7365if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7366__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7367} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {7368return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));7369}7370}7371break;7372case -4:7373if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {7374if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7375__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7376} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {7377return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));7378}7379}7380break;7381case 4:7382if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {7383if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7384__PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7385} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {7386return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));7387}7388}7389break;7390}7391#endif7392if (sizeof(PY_LONG_LONG) <= sizeof(long)) {7393__PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))7394#ifdef HAVE_LONG_LONG7395} else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {7396__PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))7397#endif7398}7399}7400{7401#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)7402PyErr_SetString(PyExc_RuntimeError,7403"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");7404#else7405PY_LONG_LONG val;7406PyObject *v = __Pyx_PyNumber_IntOrLong(x);7407#if PY_MAJOR_VERSION < 37408if (likely(v) && !PyLong_Check(v)) {7409PyObject *tmp = v;7410v = PyNumber_Long(tmp);7411Py_DECREF(tmp);7412}7413#endif7414if (likely(v)) {7415int one = 1; int is_little = (int)*(unsigned char *)&one;7416unsigned char *bytes = (unsigned char *)&val;7417int ret = _PyLong_AsByteArray((PyLongObject *)v,7418bytes, sizeof(val),7419is_little, !is_unsigned);7420Py_DECREF(v);7421if (likely(!ret))7422return val;7423}7424#endif7425return (PY_LONG_LONG) -1;7426}7427} else {7428PY_LONG_LONG val;7429PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);7430if (!tmp) return (PY_LONG_LONG) -1;7431val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);7432Py_DECREF(tmp);7433return val;7434}7435raise_overflow:7436PyErr_SetString(PyExc_OverflowError,7437"value too large to convert to PY_LONG_LONG");7438return (PY_LONG_LONG) -1;7439raise_neg_overflow:7440PyErr_SetString(PyExc_OverflowError,7441"can't convert negative value to PY_LONG_LONG");7442return (PY_LONG_LONG) -1;7443}74447445/* CIntFromPy */7446static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {7447#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7448#pragma GCC diagnostic push7449#pragma GCC diagnostic ignored "-Wconversion"7450#endif7451const long neg_one = (long) -1, const_zero = (long) 0;7452#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7453#pragma GCC diagnostic pop7454#endif7455const int is_unsigned = neg_one > const_zero;7456#if PY_MAJOR_VERSION < 37457if (likely(PyInt_Check(x))) {7458if (sizeof(long) < sizeof(long)) {7459__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))7460} else {7461long val = PyInt_AS_LONG(x);7462if (is_unsigned && unlikely(val < 0)) {7463goto raise_neg_overflow;7464}7465return (long) val;7466}7467} else7468#endif7469if (likely(PyLong_Check(x))) {7470if (is_unsigned) {7471#if CYTHON_USE_PYLONG_INTERNALS7472const digit* digits = ((PyLongObject*)x)->ob_digit;7473switch (Py_SIZE(x)) {7474case 0: return (long) 0;7475case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])7476case 2:7477if (8 * sizeof(long) > 1 * PyLong_SHIFT) {7478if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7479__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7480} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {7481return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));7482}7483}7484break;7485case 3:7486if (8 * sizeof(long) > 2 * PyLong_SHIFT) {7487if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7488__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7489} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {7490return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));7491}7492}7493break;7494case 4:7495if (8 * sizeof(long) > 3 * PyLong_SHIFT) {7496if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7497__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7498} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {7499return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));7500}7501}7502break;7503}7504#endif7505#if CYTHON_COMPILING_IN_CPYTHON7506if (unlikely(Py_SIZE(x) < 0)) {7507goto raise_neg_overflow;7508}7509#else7510{7511int result = PyObject_RichCompareBool(x, Py_False, Py_LT);7512if (unlikely(result < 0))7513return (long) -1;7514if (unlikely(result == 1))7515goto raise_neg_overflow;7516}7517#endif7518if (sizeof(long) <= sizeof(unsigned long)) {7519__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))7520#ifdef HAVE_LONG_LONG7521} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {7522__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))7523#endif7524}7525} else {7526#if CYTHON_USE_PYLONG_INTERNALS7527const digit* digits = ((PyLongObject*)x)->ob_digit;7528switch (Py_SIZE(x)) {7529case 0: return (long) 0;7530case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))7531case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])7532case -2:7533if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {7534if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7535__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7536} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {7537return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));7538}7539}7540break;7541case 2:7542if (8 * sizeof(long) > 1 * PyLong_SHIFT) {7543if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {7544__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7545} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {7546return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));7547}7548}7549break;7550case -3:7551if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {7552if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7553__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7554} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {7555return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));7556}7557}7558break;7559case 3:7560if (8 * sizeof(long) > 2 * PyLong_SHIFT) {7561if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {7562__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7563} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {7564return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));7565}7566}7567break;7568case -4:7569if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {7570if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7571__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7572} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {7573return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));7574}7575}7576break;7577case 4:7578if (8 * sizeof(long) > 3 * PyLong_SHIFT) {7579if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {7580__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))7581} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {7582return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));7583}7584}7585break;7586}7587#endif7588if (sizeof(long) <= sizeof(long)) {7589__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))7590#ifdef HAVE_LONG_LONG7591} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {7592__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))7593#endif7594}7595}7596{7597#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)7598PyErr_SetString(PyExc_RuntimeError,7599"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");7600#else7601long val;7602PyObject *v = __Pyx_PyNumber_IntOrLong(x);7603#if PY_MAJOR_VERSION < 37604if (likely(v) && !PyLong_Check(v)) {7605PyObject *tmp = v;7606v = PyNumber_Long(tmp);7607Py_DECREF(tmp);7608}7609#endif7610if (likely(v)) {7611int one = 1; int is_little = (int)*(unsigned char *)&one;7612unsigned char *bytes = (unsigned char *)&val;7613int ret = _PyLong_AsByteArray((PyLongObject *)v,7614bytes, sizeof(val),7615is_little, !is_unsigned);7616Py_DECREF(v);7617if (likely(!ret))7618return val;7619}7620#endif7621return (long) -1;7622}7623} else {7624long val;7625PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);7626if (!tmp) return (long) -1;7627val = __Pyx_PyInt_As_long(tmp);7628Py_DECREF(tmp);7629return val;7630}7631raise_overflow:7632PyErr_SetString(PyExc_OverflowError,7633"value too large to convert to long");7634return (long) -1;7635raise_neg_overflow:7636PyErr_SetString(PyExc_OverflowError,7637"can't convert negative value to long");7638return (long) -1;7639}76407641/* CIntToPy */7642static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {7643#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7644#pragma GCC diagnostic push7645#pragma GCC diagnostic ignored "-Wconversion"7646#endif7647const long neg_one = (long) -1, const_zero = (long) 0;7648#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7649#pragma GCC diagnostic pop7650#endif7651const int is_unsigned = neg_one > const_zero;7652if (is_unsigned) {7653if (sizeof(long) < sizeof(long)) {7654return PyInt_FromLong((long) value);7655} else if (sizeof(long) <= sizeof(unsigned long)) {7656return PyLong_FromUnsignedLong((unsigned long) value);7657#ifdef HAVE_LONG_LONG7658} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {7659return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);7660#endif7661}7662} else {7663if (sizeof(long) <= sizeof(long)) {7664return PyInt_FromLong((long) value);7665#ifdef HAVE_LONG_LONG7666} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {7667return PyLong_FromLongLong((PY_LONG_LONG) value);7668#endif7669}7670}7671{7672int one = 1; int little = (int)*(unsigned char *)&one;7673unsigned char *bytes = (unsigned char *)&value;7674return _PyLong_FromByteArray(bytes, sizeof(long),7675little, !is_unsigned);7676}7677}76787679/* CIntToPy */7680static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {7681#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7682#pragma GCC diagnostic push7683#pragma GCC diagnostic ignored "-Wconversion"7684#endif7685const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;7686#ifdef __Pyx_HAS_GCC_DIAGNOSTIC7687#pragma GCC diagnostic pop7688#endif7689const int is_unsigned = neg_one > const_zero;7690if (is_unsigned) {7691if (sizeof(PY_LONG_LONG) < sizeof(long)) {7692return PyInt_FromLong((long) value);7693} else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {7694return PyLong_FromUnsignedLong((unsigned long) value);7695#ifdef HAVE_LONG_LONG7696} else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {7697return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);7698#endif7699}7700} else {7701if (sizeof(PY_LONG_LONG) <= sizeof(long)) {7702return PyInt_FromLong((long) value);7703#ifdef HAVE_LONG_LONG7704} else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {7705return PyLong_FromLongLong((PY_LONG_LONG) value);7706#endif7707}7708}7709{7710int one = 1; int little = (int)*(unsigned char *)&one;7711unsigned char *bytes = (unsigned char *)&value;7712return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),7713little, !is_unsigned);7714}7715}77167717/* FastTypeChecks */7718#if CYTHON_COMPILING_IN_CPYTHON7719static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {7720while (a) {7721a = a->tp_base;7722if (a == b)7723return 1;7724}7725return b == &PyBaseObject_Type;7726}7727static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {7728PyObject *mro;7729if (a == b) return 1;7730mro = a->tp_mro;7731if (likely(mro)) {7732Py_ssize_t i, n;7733n = PyTuple_GET_SIZE(mro);7734for (i = 0; i < n; i++) {7735if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)7736return 1;7737}7738return 0;7739}7740return __Pyx_InBases(a, b);7741}7742#if PY_MAJOR_VERSION == 27743static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {7744PyObject *exception, *value, *tb;7745int res;7746__Pyx_PyThreadState_declare7747__Pyx_PyThreadState_assign7748__Pyx_ErrFetch(&exception, &value, &tb);7749res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;7750if (unlikely(res == -1)) {7751PyErr_WriteUnraisable(err);7752res = 0;7753}7754if (!res) {7755res = PyObject_IsSubclass(err, exc_type2);7756if (unlikely(res == -1)) {7757PyErr_WriteUnraisable(err);7758res = 0;7759}7760}7761__Pyx_ErrRestore(exception, value, tb);7762return res;7763}7764#else7765static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {7766int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;7767if (!res) {7768res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);7769}7770return res;7771}7772#endif7773static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {7774Py_ssize_t i, n;7775assert(PyExceptionClass_Check(exc_type));7776n = PyTuple_GET_SIZE(tuple);7777#if PY_MAJOR_VERSION >= 37778for (i=0; i<n; i++) {7779if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;7780}7781#endif7782for (i=0; i<n; i++) {7783PyObject *t = PyTuple_GET_ITEM(tuple, i);7784#if PY_MAJOR_VERSION < 37785if (likely(exc_type == t)) return 1;7786#endif7787if (likely(PyExceptionClass_Check(t))) {7788if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;7789} else {7790}7791}7792return 0;7793}7794static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {7795if (likely(err == exc_type)) return 1;7796if (likely(PyExceptionClass_Check(err))) {7797if (likely(PyExceptionClass_Check(exc_type))) {7798return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);7799} else if (likely(PyTuple_Check(exc_type))) {7800return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);7801} else {7802}7803}7804return PyErr_GivenExceptionMatches(err, exc_type);7805}7806static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {7807assert(PyExceptionClass_Check(exc_type1));7808assert(PyExceptionClass_Check(exc_type2));7809if (likely(err == exc_type1 || err == exc_type2)) return 1;7810if (likely(PyExceptionClass_Check(err))) {7811return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);7812}7813return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));7814}7815#endif78167817/* CheckBinaryVersion */7818static int __Pyx_check_binary_version(void) {7819char ctversion[5];7820int same=1, i, found_dot;7821const char* rt_from_call = Py_GetVersion();7822PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);7823found_dot = 0;7824for (i = 0; i < 4; i++) {7825if (!ctversion[i]) {7826same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');7827break;7828}7829if (rt_from_call[i] != ctversion[i]) {7830same = 0;7831break;7832}7833}7834if (!same) {7835char rtversion[5] = {'\0'};7836char message[200];7837for (i=0; i<4; ++i) {7838if (rt_from_call[i] == '.') {7839if (found_dot) break;7840found_dot = 1;7841} else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {7842break;7843}7844rtversion[i] = rt_from_call[i];7845}7846PyOS_snprintf(message, sizeof(message),7847"compiletime version %s of module '%.100s' "7848"does not match runtime version %s",7849ctversion, __Pyx_MODULE_NAME, rtversion);7850return PyErr_WarnEx(NULL, message, 1);7851}7852return 0;7853}78547855/* FunctionImport */7856#ifndef __PYX_HAVE_RT_ImportFunction7857#define __PYX_HAVE_RT_ImportFunction7858static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {7859PyObject *d = 0;7860PyObject *cobj = 0;7861union {7862void (*fp)(void);7863void *p;7864} tmp;7865d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");7866if (!d)7867goto bad;7868cobj = PyDict_GetItemString(d, funcname);7869if (!cobj) {7870PyErr_Format(PyExc_ImportError,7871"%.200s does not export expected C function %.200s",7872PyModule_GetName(module), funcname);7873goto bad;7874}7875#if PY_VERSION_HEX >= 0x020700007876if (!PyCapsule_IsValid(cobj, sig)) {7877PyErr_Format(PyExc_TypeError,7878"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",7879PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));7880goto bad;7881}7882tmp.p = PyCapsule_GetPointer(cobj, sig);7883#else7884{const char *desc, *s1, *s2;7885desc = (const char *)PyCObject_GetDesc(cobj);7886if (!desc)7887goto bad;7888s1 = desc; s2 = sig;7889while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }7890if (*s1 != *s2) {7891PyErr_Format(PyExc_TypeError,7892"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",7893PyModule_GetName(module), funcname, sig, desc);7894goto bad;7895}7896tmp.p = PyCObject_AsVoidPtr(cobj);}7897#endif7898*f = tmp.fp;7899if (!(*f))7900goto bad;7901Py_DECREF(d);7902return 0;7903bad:7904Py_XDECREF(d);7905return -1;7906}7907#endif79087909/* InitStrings */7910static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {7911while (t->p) {7912#if PY_MAJOR_VERSION < 37913if (t->is_unicode) {7914*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);7915} else if (t->intern) {7916*t->p = PyString_InternFromString(t->s);7917} else {7918*t->p = PyString_FromStringAndSize(t->s, t->n - 1);7919}7920#else7921if (t->is_unicode | t->is_str) {7922if (t->intern) {7923*t->p = PyUnicode_InternFromString(t->s);7924} else if (t->encoding) {7925*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);7926} else {7927*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);7928}7929} else {7930*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);7931}7932#endif7933if (!*t->p)7934return -1;7935if (PyObject_Hash(*t->p) == -1)7936return -1;7937++t;7938}7939return 0;7940}79417942static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {7943return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));7944}7945static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {7946Py_ssize_t ignore;7947return __Pyx_PyObject_AsStringAndSize(o, &ignore);7948}7949#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT7950#if !CYTHON_PEP393_ENABLED7951static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {7952char* defenc_c;7953PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);7954if (!defenc) return NULL;7955defenc_c = PyBytes_AS_STRING(defenc);7956#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII7957{7958char* end = defenc_c + PyBytes_GET_SIZE(defenc);7959char* c;7960for (c = defenc_c; c < end; c++) {7961if ((unsigned char) (*c) >= 128) {7962PyUnicode_AsASCIIString(o);7963return NULL;7964}7965}7966}7967#endif7968*length = PyBytes_GET_SIZE(defenc);7969return defenc_c;7970}7971#else7972static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {7973if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;7974#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII7975if (likely(PyUnicode_IS_ASCII(o))) {7976*length = PyUnicode_GET_LENGTH(o);7977return PyUnicode_AsUTF8(o);7978} else {7979PyUnicode_AsASCIIString(o);7980return NULL;7981}7982#else7983return PyUnicode_AsUTF8AndSize(o, length);7984#endif7985}7986#endif7987#endif7988static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {7989#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT7990if (7991#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII7992__Pyx_sys_getdefaultencoding_not_ascii &&7993#endif7994PyUnicode_Check(o)) {7995return __Pyx_PyUnicode_AsStringAndSize(o, length);7996} else7997#endif7998#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))7999if (PyByteArray_Check(o)) {8000*length = PyByteArray_GET_SIZE(o);8001return PyByteArray_AS_STRING(o);8002} else8003#endif8004{8005char* result;8006int r = PyBytes_AsStringAndSize(o, &result, length);8007if (unlikely(r < 0)) {8008return NULL;8009} else {8010return result;8011}8012}8013}8014static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {8015int is_true = x == Py_True;8016if (is_true | (x == Py_False) | (x == Py_None)) return is_true;8017else return PyObject_IsTrue(x);8018}8019static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {8020int retval;8021if (unlikely(!x)) return -1;8022retval = __Pyx_PyObject_IsTrue(x);8023Py_DECREF(x);8024return retval;8025}8026static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {8027#if PY_MAJOR_VERSION >= 38028if (PyLong_Check(result)) {8029if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,8030"__int__ returned non-int (type %.200s). "8031"The ability to return an instance of a strict subclass of int "8032"is deprecated, and may be removed in a future version of Python.",8033Py_TYPE(result)->tp_name)) {8034Py_DECREF(result);8035return NULL;8036}8037return result;8038}8039#endif8040PyErr_Format(PyExc_TypeError,8041"__%.4s__ returned non-%.4s (type %.200s)",8042type_name, type_name, Py_TYPE(result)->tp_name);8043Py_DECREF(result);8044return NULL;8045}8046static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {8047#if CYTHON_USE_TYPE_SLOTS8048PyNumberMethods *m;8049#endif8050const char *name = NULL;8051PyObject *res = NULL;8052#if PY_MAJOR_VERSION < 38053if (likely(PyInt_Check(x) || PyLong_Check(x)))8054#else8055if (likely(PyLong_Check(x)))8056#endif8057return __Pyx_NewRef(x);8058#if CYTHON_USE_TYPE_SLOTS8059m = Py_TYPE(x)->tp_as_number;8060#if PY_MAJOR_VERSION < 38061if (m && m->nb_int) {8062name = "int";8063res = m->nb_int(x);8064}8065else if (m && m->nb_long) {8066name = "long";8067res = m->nb_long(x);8068}8069#else8070if (likely(m && m->nb_int)) {8071name = "int";8072res = m->nb_int(x);8073}8074#endif8075#else8076if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {8077res = PyNumber_Int(x);8078}8079#endif8080if (likely(res)) {8081#if PY_MAJOR_VERSION < 38082if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {8083#else8084if (unlikely(!PyLong_CheckExact(res))) {8085#endif8086return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);8087}8088}8089else if (!PyErr_Occurred()) {8090PyErr_SetString(PyExc_TypeError,8091"an integer is required");8092}8093return res;8094}8095static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {8096Py_ssize_t ival;8097PyObject *x;8098#if PY_MAJOR_VERSION < 38099if (likely(PyInt_CheckExact(b))) {8100if (sizeof(Py_ssize_t) >= sizeof(long))8101return PyInt_AS_LONG(b);8102else8103return PyInt_AsSsize_t(b);8104}8105#endif8106if (likely(PyLong_CheckExact(b))) {8107#if CYTHON_USE_PYLONG_INTERNALS8108const digit* digits = ((PyLongObject*)b)->ob_digit;8109const Py_ssize_t size = Py_SIZE(b);8110if (likely(__Pyx_sst_abs(size) <= 1)) {8111ival = likely(size) ? digits[0] : 0;8112if (size == -1) ival = -ival;8113return ival;8114} else {8115switch (size) {8116case 2:8117if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {8118return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));8119}8120break;8121case -2:8122if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {8123return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));8124}8125break;8126case 3:8127if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {8128return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));8129}8130break;8131case -3:8132if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {8133return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));8134}8135break;8136case 4:8137if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {8138return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));8139}8140break;8141case -4:8142if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {8143return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));8144}8145break;8146}8147}8148#endif8149return PyLong_AsSsize_t(b);8150}8151x = PyNumber_Index(b);8152if (!x) return -1;8153ival = PyInt_AsSsize_t(x);8154Py_DECREF(x);8155return ival;8156}8157static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {8158if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {8159return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);8160#if PY_MAJOR_VERSION < 38161} else if (likely(PyInt_CheckExact(o))) {8162return PyInt_AS_LONG(o);8163#endif8164} else {8165Py_ssize_t ival;8166PyObject *x;8167x = PyNumber_Index(o);8168if (!x) return -1;8169ival = PyInt_AsLong(x);8170Py_DECREF(x);8171return ival;8172}8173}8174static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {8175return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);8176}8177static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {8178return PyInt_FromSize_t(ival);8179}818081818182#endif /* Py_PYTHON_H */818381848185