/* Generated by Cython 0.23.4 */

/* BEGIN: Cython Metadata
{
    "distutils": {}
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_4"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__cycloudpickle__cypickle
#define __PYX_HAVE_API__cycloudpickle__cypickle
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "cycloudpickle/cypickle.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_13cycloudpickle_8cypickle__Framer;
struct __pyx_obj_13cycloudpickle_8cypickle_Pickler;
struct __pyx_opt_args_13cycloudpickle_8cypickle__getattribute;
struct __pyx_opt_args_13cycloudpickle_8cypickle_whichmodule;

/* "cycloudpickle/cypickle.pyx":195
 * # Tools used for pickling.
 * 
 * cdef _getattribute(object obj, str name, bint allow_qualname=False):             # <<<<<<<<<<<<<<
 *     cdef list dotted_path = name.split(".")
 *     cdef str subpath
 */
struct __pyx_opt_args_13cycloudpickle_8cypickle__getattribute {
  int __pyx_n;
  int allow_qualname;
};

/* "cycloudpickle/cypickle.pyx":213
 *     return obj
 * 
 * cdef whichmodule(object obj, str name, bint allow_qualname=False):             # <<<<<<<<<<<<<<
 *     """Find the module an object belong to."""
 *     cdef str module_name = getattr(obj, '__module__', None)
 */
struct __pyx_opt_args_13cycloudpickle_8cypickle_whichmodule {
  int __pyx_n;
  int allow_qualname;
};

/* "cycloudpickle/cypickle.pxd":1
 * cdef class _Framer:             # <<<<<<<<<<<<<<
 *     cdef object file_write
 *     cdef object current_frame
 */
struct __pyx_obj_13cycloudpickle_8cypickle__Framer {
  PyObject_HEAD
  PyObject *file_write;
  PyObject *current_frame;
};


/* "cycloudpickle/cypickle.pxd":5
 *     cdef object current_frame
 * 
 * cdef class Pickler:             # <<<<<<<<<<<<<<
 *     cdef int protocol
 *     cdef int proto
 */
struct __pyx_obj_13cycloudpickle_8cypickle_Pickler {
  PyObject_HEAD
  int protocol;
  int proto;
  int bin;
  int fast;
  int fix_imports;
  PyObject *_file_write;
  struct __pyx_obj_13cycloudpickle_8cypickle__Framer *framer;
  PyObject *write;
  PyObject *memo;
};


/* --- Runtime support code (head) --- */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

static CYTHON_INLINE int __Pyx_IterFinish(void);

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, int has_known_size, int decref_tuple);

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_RshiftObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceRshift(op1, op2) : PyNumber_Rshift(op1, op2))
#endif

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AndObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAnd(op1, op2) : PyNumber_And(op1, op2))
#endif

#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)

static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'cycloudpickle.cypickle' */
static PyTypeObject *__pyx_ptype_13cycloudpickle_8cypickle__Framer = 0;
static PyTypeObject *__pyx_ptype_13cycloudpickle_8cypickle_Pickler = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_bytes_types = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_format_version = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_compatible_formats = 0;
static int __pyx_v_13cycloudpickle_8cypickle_HIGHEST_PROTOCOL;
static int __pyx_v_13cycloudpickle_8cypickle_DEFAULT_PROTOCOL;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_MARK = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_STOP = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_POP = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_POP_MARK = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_DUP = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_FLOAT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_INT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BININT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BININT1 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_LONG = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BININT2 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_NONE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_PERSID = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINPERSID = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_REDUCE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_STRING = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINSTRING = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_SHORT_BINSTRING = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_UNICODE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINUNICODE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_APPEND = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BUILD = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_GLOBAL = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_DICT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_APPENDS = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_GET = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINGET = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_INST = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_LONG_BINGET = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_LIST = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_OBJ = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_PUT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINPUT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_LONG_BINPUT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_SETITEM = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_TUPLE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_SETITEMS = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINFLOAT = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_TRUE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_FALSE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_PROTO = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_NEWOBJ = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EXT1 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EXT2 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EXT4 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_TUPLE1 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_TUPLE2 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_TUPLE3 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_NEWTRUE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_NEWFALSE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_LONG1 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_LONG4 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle__tuplesize2code = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINBYTES = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_SHORT_BINBYTES = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_SHORT_BINUNICODE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINUNICODE8 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_BINBYTES8 = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_EMPTY_SET = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_ADDITEMS = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_FROZENSET = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_MEMOIZE = 0;
static PyObject *__pyx_v_13cycloudpickle_8cypickle_FRAME = 0;
static PyObject *__pyx_f_13cycloudpickle_8cypickle__getattribute(PyObject *, PyObject *, struct __pyx_opt_args_13cycloudpickle_8cypickle__getattribute *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_8cypickle_whichmodule(PyObject *, PyObject *, struct __pyx_opt_args_13cycloudpickle_8cypickle_whichmodule *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_8cypickle_encode_long(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "cycloudpickle.cypickle"
int __pyx_module_is_main_cycloudpickle__cypickle = 0;

/* Implementation of 'cycloudpickle.cypickle' */
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_UnicodeEncodeError;
static PyObject *__pyx_builtin_NotImplemented;
static char __pyx_k_0[] = "0";
static char __pyx_k_1[] = "1";
static char __pyx_k_2[] = "2";
static char __pyx_k_B[] = "<B";
static char __pyx_k_C[] = "C";
static char __pyx_k_F[] = "F";
static char __pyx_k_G[] = "G";
static char __pyx_k_H[] = "<H";
static char __pyx_k_I[] = "<I";
static char __pyx_k_J[] = "J";
static char __pyx_k_K[] = "K";
static char __pyx_k_L[] = "L\n";
static char __pyx_k_M[] = "M";
static char __pyx_k_N[] = "N";
static char __pyx_k_P[] = "P";
static char __pyx_k_Q[] = "<Q";
static char __pyx_k_R[] = "R";
static char __pyx_k_S[] = "S";
static char __pyx_k_T[] = "T";
static char __pyx_k_U[] = "U";
static char __pyx_k_V[] = "V";
static char __pyx_k_X[] = "X";
static char __pyx_k_a[] = "a";
static char __pyx_k_b[] = "b";
static char __pyx_k_c[] = "c";
static char __pyx_k_d[] = ">d";
static char __pyx_k_e[] = "e";
static char __pyx_k_g[] = "g";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "<i";
static char __pyx_k_j[] = "j";
static char __pyx_k_l[] = "l";
static char __pyx_k_o[] = "o";
static char __pyx_k_p[] = "p";
static char __pyx_k_q[] = "q";
static char __pyx_k_r[] = "r";
static char __pyx_k_s[] = "s";
static char __pyx_k_t[] = "t";
static char __pyx_k_u[] = "u";
static char __pyx_k_x[] = "x";
static char __pyx_k__3[] = ".";
static char __pyx_k__4[] = "";
static char __pyx_k__7[] = "\n";
static char __pyx_k_id[] = "id";
static char __pyx_k_io[] = "io";
static char __pyx_k_re[] = "re";
static char __pyx_k_1_0[] = "1.0";
static char __pyx_k_1_1[] = "1.1";
static char __pyx_k_1_2[] = "1.2";
static char __pyx_k_1_3[] = "1.3";
static char __pyx_k_2_0[] = "2.0";
static char __pyx_k_3_0[] = "3.0";
static char __pyx_k_4_0[] = "4.0";
static char __pyx_k_B_2[] = "B";
static char __pyx_k_I00[] = "I00\n";
static char __pyx_k_I01[] = "I01\n";
static char __pyx_k_I_2[] = "I";
static char __pyx_k_L_2[] = "L";
static char __pyx_k_Q_2[] = "Q";
static char __pyx_k__17[] = "\\";
static char __pyx_k__23[] = "(";
static char __pyx_k__24[] = "}";
static char __pyx_k__25[] = "]";
static char __pyx_k__26[] = ")";
static char __pyx_k__27[] = "\200";
static char __pyx_k__28[] = "\201";
static char __pyx_k__29[] = "\202";
static char __pyx_k__30[] = "\203";
static char __pyx_k__31[] = "\204";
static char __pyx_k__32[] = "\205";
static char __pyx_k__33[] = "\206";
static char __pyx_k__34[] = "\207";
static char __pyx_k__35[] = "\210";
static char __pyx_k__36[] = "\211";
static char __pyx_k__37[] = "\212";
static char __pyx_k__38[] = "\213";
static char __pyx_k__39[] = "\214";
static char __pyx_k__40[] = "\215";
static char __pyx_k__41[] = "\216";
static char __pyx_k__42[] = "\217";
static char __pyx_k__43[] = "\220";
static char __pyx_k__44[] = "\221";
static char __pyx_k__45[] = "\222";
static char __pyx_k__46[] = "\223";
static char __pyx_k__47[] = "\224";
static char __pyx_k__48[] = "\225";
static char __pyx_k_all[] = "__all__";
static char __pyx_k_d_2[] = "d";
static char __pyx_k_get[] = "get";
static char __pyx_k_i_2[] = "i";
static char __pyx_k_new[] = "__new__";
static char __pyx_k_obj[] = "obj";
static char __pyx_k_put[] = "put";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_args[] = "args";
static char __pyx_k_dump[] = "dump";
static char __pyx_k_exit[] = "__exit__";
static char __pyx_k_file[] = "file";
static char __pyx_k_func[] = "func";
static char __pyx_k_load[] = "load";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_name[] = "__name__";
static char __pyx_k_pack[] = "pack";
static char __pyx_k_save[] = "save";
static char __pyx_k_seek[] = "seek";
static char __pyx_k_tell[] = "tell";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_ascii[] = "ascii";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_dumps[] = "dumps";
static char __pyx_k_enter[] = "__enter__";
static char __pyx_k_force[] = "force";
static char __pyx_k_items[] = "items";
static char __pyx_k_level[] = "level";
static char __pyx_k_loads[] = "loads";
static char __pyx_k_match[] = "match";
static char __pyx_k_state[] = "state";
static char __pyx_k_types[] = "types";
static char __pyx_k_u000a[] = "\\u000a";
static char __pyx_k_u005c[] = "\\u005c";
static char __pyx_k_utf_8[] = "utf-8";
static char __pyx_k_write[] = "write";
static char __pyx_k_codecs[] = "codecs";
static char __pyx_k_encode[] = "encode";
static char __pyx_k_extend[] = "extend";
static char __pyx_k_format[] = "format";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_islice[] = "islice";
static char __pyx_k_latin1[] = "latin1";
static char __pyx_k_little[] = "little";
static char __pyx_k_locals[] = "<locals>";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_name_2[] = "name";
static char __pyx_k_newobj[] = "__newobj__";
static char __pyx_k_pickle[] = "pickle";
static char __pyx_k_reduce[] = "__reduce__";
static char __pyx_k_signed[] = "signed";
static char __pyx_k_struct[] = "struct";
static char __pyx_k_unpack[] = "unpack";
static char __pyx_k_BytesIO[] = "BytesIO";
static char __pyx_k_Pickler[] = "Pickler";
static char __pyx_k_copyreg[] = "copyreg";
static char __pyx_k_maxsize[] = "maxsize";
static char __pyx_k_memoize[] = "memoize";
static char __pyx_k_modules[] = "modules";
static char __pyx_k_replace[] = "replace";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_dispatch[] = "dispatch";
static char __pyx_k_protocol[] = "protocol";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_save_set[] = "save_set";
static char __pyx_k_save_str[] = "save_str";
static char __pyx_k_to_bytes[] = "to_bytes";
static char __pyx_k_truncate[] = "truncate";
static char __pyx_k_BATCHSIZE[] = "_BATCHSIZE";
static char __pyx_k_TypeError[] = "TypeError";
static char __pyx_k_Unpickler[] = "Unpickler";
static char __pyx_k_byteorder[] = "byteorder";
static char __pyx_k_dictitems[] = "dictitems";
static char __pyx_k_getbuffer[] = "getbuffer";
static char __pyx_k_itertools[] = "itertools";
static char __pyx_k_listitems[] = "listitems";
static char __pyx_k_newobj_ex[] = "__newobj_ex__";
static char __pyx_k_reduce_ex[] = "__reduce_ex__";
static char __pyx_k_save_bool[] = "save_bool";
static char __pyx_k_save_dict[] = "save_dict";
static char __pyx_k_save_list[] = "save_list";
static char __pyx_k_save_long[] = "save_long";
static char __pyx_k_save_none[] = "save_none";
static char __pyx_k_save_pers[] = "save_pers";
static char __pyx_k_save_type[] = "save_type";
static char __pyx_k_A_Z_A_Z0_9[] = "[A-Z][A-Z0-9_]+$";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_bit_length[] = "bit_length";
static char __pyx_k_file_write[] = "file_write";
static char __pyx_k_save_bytes[] = "save_bytes";
static char __pyx_k_save_float[] = "save_float";
static char __pyx_k_save_tuple[] = "save_tuple";
static char __pyx_k_ImportError[] = "ImportError";
static char __pyx_k_PickleError[] = "PickleError";
static char __pyx_k_end_framing[] = "end_framing";
static char __pyx_k_fix_imports[] = "fix_imports";
static char __pyx_k_save_global[] = "save_global";
static char __pyx_k_save_reduce[] = "save_reduce";
static char __pyx_k_FunctionType[] = "FunctionType";
static char __pyx_k_commit_frame[] = "commit_frame";
static char __pyx_k_PicklingError[] = "PicklingError";
static char __pyx_k_batch_appends[] = "_batch_appends";
static char __pyx_k_compat_pickle[] = "_compat_pickle";
static char __pyx_k_persistent_id[] = "persistent_id";
static char __pyx_k_start_framing[] = "start_framing";
static char __pyx_k_surrogatepass[] = "surrogatepass";
static char __pyx_k_AttributeError[] = "AttributeError";
static char __pyx_k_NotImplemented[] = "NotImplemented";
static char __pyx_k_batch_setitems[] = "_batch_setitems";
static char __pyx_k_dispatch_table[] = "dispatch_table";
static char __pyx_k_save_frozenset[] = "save_frozenset";
static char __pyx_k_UnpicklingError[] = "UnpicklingError";
static char __pyx_k_extension_cache[] = "_extension_cache";
static char __pyx_k_FRAME_SIZE_TARGET[] = "_FRAME_SIZE_TARGET";
static char __pyx_k_inverted_registry[] = "_inverted_registry";
static char __pyx_k_UnicodeEncodeError[] = "UnicodeEncodeError";
static char __pyx_k_extension_registry[] = "_extension_registry";
static char __pyx_k_raw_unicode_escape[] = "raw-unicode-escape";
static char __pyx_k_save_persistent_id[] = "save_persistent_id";
static char __pyx_k_REVERSE_NAME_MAPPING[] = "REVERSE_NAME_MAPPING";
static char __pyx_k_REVERSE_IMPORT_MAPPING[] = "REVERSE_IMPORT_MAPPING";
static char __pyx_k_Can_t_pickle_r_object_r[] = "Can't pickle %r object: %r";
static char __pyx_k_pickle_protocol_must_be_d[] = "pickle protocol must be <= %d";
static char __pyx_k_Can_t_get_attribute_r_on_r[] = "Can't get attribute {!r} on {!r}";
static char __pyx_k_args_0_from_args_has_no___new[] = "args[0] from {} args has no __new__";
static char __pyx_k_s_must_return_string_or_tuple[] = "%s must return string or tuple";
static char __pyx_k_Can_t_get_qualified_attribute_r[] = "Can't get qualified attribute {!r} on {!r}; ";
static char __pyx_k_This_file_is_an_adaptation_of_p[] = "\nThis file is an adaptation of python pickle (not cPickle) to use Cython.\n\n---\n\nCreate portable serialized representations of Python objects.\n\nSee module copyreg for a mechanism for registering custom picklers.\nSee module pickletools source for extensive comments.\n\nClasses:\n\n    Pickler\n    Unpickler\n\nFunctions:\n\n    dump(object, file)\n    dumps(object) -> string\n    load(file) -> object\n    loads(string) -> object\n\nMisc variables:\n\n    __version__\n    format_version\n    compatible_formats\n\n";
static char __pyx_k_args_0_from___newobj___args_has[] = "args[0] from __newobj__ args has no __new__";
static char __pyx_k_args_from_save_reduce_must_be_a[] = "args from save_reduce() must be a tuple";
static char __pyx_k_Can_t_get_local_attribute_r_on_r[] = "Can't get local attribute {!r} on {!r}";
static char __pyx_k_Can_t_pickle_r_it_s_not_found_as[] = "Can't pickle %r: it's not found as %s.%s";
static char __pyx_k_Can_t_pickle_r_it_s_not_the_same[] = "Can't pickle %r: it's not the same object as %s.%s";
static char __pyx_k_Tuple_returned_by_s_must_have_tw[] = "Tuple returned by %s must have two to five elements";
static char __pyx_k_args_0_from_args_has_the_wrong_c[] = "args[0] from {} args has the wrong class";
static char __pyx_k_can_t_pickle_global_identifier_s[] = "can't pickle global identifier '%s.%s' using pickle protocol %i";
static char __pyx_k_file_must_have_a_write_attribute[] = "file must have a 'write' attribute";
static char __pyx_k_func_from_save_reduce_must_be_ca[] = "func from save_reduce() must be callable";
static char __pyx_k_use_protocols_4_to_enable_suppor[] = "use protocols >= 4 to enable support";
static char __pyx_k_args_0_from___newobj___args_has_2[] = "args[0] from __newobj__ args has the wrong class";
static PyObject *__pyx_kp_b_0;
static PyObject *__pyx_kp_b_1;
static PyObject *__pyx_kp_u_1_0;
static PyObject *__pyx_kp_u_1_1;
static PyObject *__pyx_kp_u_1_2;
static PyObject *__pyx_kp_u_1_3;
static PyObject *__pyx_kp_b_2;
static PyObject *__pyx_kp_u_2_0;
static PyObject *__pyx_kp_u_3_0;
static PyObject *__pyx_kp_u_4_0;
static PyObject *__pyx_kp_u_A_Z_A_Z0_9;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_u_B;
static PyObject *__pyx_n_s_BATCHSIZE;
static PyObject *__pyx_n_b_B_2;
static PyObject *__pyx_n_s_BytesIO;
static PyObject *__pyx_n_b_C;
static PyObject *__pyx_kp_u_Can_t_get_attribute_r_on_r;
static PyObject *__pyx_kp_u_Can_t_get_local_attribute_r_on_r;
static PyObject *__pyx_kp_u_Can_t_get_qualified_attribute_r;
static PyObject *__pyx_kp_u_Can_t_pickle_r_it_s_not_found_as;
static PyObject *__pyx_kp_u_Can_t_pickle_r_it_s_not_the_same;
static PyObject *__pyx_kp_u_Can_t_pickle_r_object_r;
static PyObject *__pyx_n_b_F;
static PyObject *__pyx_n_s_FRAME_SIZE_TARGET;
static PyObject *__pyx_n_s_FunctionType;
static PyObject *__pyx_n_b_G;
static PyObject *__pyx_kp_u_H;
static PyObject *__pyx_kp_u_I;
static PyObject *__pyx_n_b_I00;
static PyObject *__pyx_n_b_I01;
static PyObject *__pyx_n_b_I_2;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_b_J;
static PyObject *__pyx_n_b_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_b_L;
static PyObject *__pyx_n_b_L_2;
static PyObject *__pyx_n_b_M;
static PyObject *__pyx_n_b_N;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_b_P;
static PyObject *__pyx_n_u_PickleError;
static PyObject *__pyx_n_u_Pickler;
static PyObject *__pyx_n_s_PicklingError;
static PyObject *__pyx_n_u_PicklingError;
static PyObject *__pyx_kp_u_Q;
static PyObject *__pyx_n_b_Q_2;
static PyObject *__pyx_n_b_R;
static PyObject *__pyx_n_s_REVERSE_IMPORT_MAPPING;
static PyObject *__pyx_n_s_REVERSE_NAME_MAPPING;
static PyObject *__pyx_n_b_S;
static PyObject *__pyx_n_b_T;
static PyObject *__pyx_kp_u_Tuple_returned_by_s_must_have_tw;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_b_U;
static PyObject *__pyx_n_s_UnicodeEncodeError;
static PyObject *__pyx_n_u_Unpickler;
static PyObject *__pyx_n_u_UnpicklingError;
static PyObject *__pyx_n_b_V;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_b_X;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_b__23;
static PyObject *__pyx_kp_b__24;
static PyObject *__pyx_kp_b__25;
static PyObject *__pyx_kp_b__26;
static PyObject *__pyx_kp_b__27;
static PyObject *__pyx_kp_b__28;
static PyObject *__pyx_kp_b__29;
static PyObject *__pyx_kp_b__3;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_b__30;
static PyObject *__pyx_kp_b__31;
static PyObject *__pyx_kp_b__32;
static PyObject *__pyx_kp_b__33;
static PyObject *__pyx_kp_b__34;
static PyObject *__pyx_kp_b__35;
static PyObject *__pyx_kp_b__36;
static PyObject *__pyx_kp_b__37;
static PyObject *__pyx_kp_b__38;
static PyObject *__pyx_kp_b__39;
static PyObject *__pyx_kp_b__4;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_b__40;
static PyObject *__pyx_kp_b__41;
static PyObject *__pyx_kp_b__42;
static PyObject *__pyx_kp_b__43;
static PyObject *__pyx_kp_b__44;
static PyObject *__pyx_kp_b__45;
static PyObject *__pyx_kp_b__46;
static PyObject *__pyx_kp_b__47;
static PyObject *__pyx_kp_b__48;
static PyObject *__pyx_kp_b__7;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_n_b_a;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_kp_u_args_0_from___newobj___args_has;
static PyObject *__pyx_kp_u_args_0_from___newobj___args_has_2;
static PyObject *__pyx_kp_u_args_0_from_args_has_no___new;
static PyObject *__pyx_kp_u_args_0_from_args_has_the_wrong_c;
static PyObject *__pyx_kp_u_args_from_save_reduce_must_be_a;
static PyObject *__pyx_n_u_ascii;
static PyObject *__pyx_n_b_b;
static PyObject *__pyx_n_s_batch_appends;
static PyObject *__pyx_n_s_batch_setitems;
static PyObject *__pyx_n_s_bit_length;
static PyObject *__pyx_n_s_byteorder;
static PyObject *__pyx_n_b_c;
static PyObject *__pyx_kp_u_can_t_pickle_global_identifier_s;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_codecs;
static PyObject *__pyx_n_s_commit_frame;
static PyObject *__pyx_n_s_compat_pickle;
static PyObject *__pyx_n_s_copyreg;
static PyObject *__pyx_kp_u_d;
static PyObject *__pyx_n_b_d_2;
static PyObject *__pyx_n_s_dictitems;
static PyObject *__pyx_n_s_dispatch;
static PyObject *__pyx_n_s_dispatch_table;
static PyObject *__pyx_n_u_dispatch_table;
static PyObject *__pyx_n_u_dump;
static PyObject *__pyx_n_u_dumps;
static PyObject *__pyx_n_b_e;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end_framing;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_s_extension_cache;
static PyObject *__pyx_n_s_extension_registry;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_kp_u_file_must_have_a_write_attribute;
static PyObject *__pyx_n_s_file_write;
static PyObject *__pyx_n_s_fix_imports;
static PyObject *__pyx_n_s_force;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_kp_u_func_from_save_reduce_must_be_ca;
static PyObject *__pyx_n_b_g;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_getbuffer;
static PyObject *__pyx_n_b_h;
static PyObject *__pyx_kp_u_i;
static PyObject *__pyx_n_b_i_2;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_inverted_registry;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_islice;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_b_j;
static PyObject *__pyx_n_b_l;
static PyObject *__pyx_n_u_latin1;
static PyObject *__pyx_n_s_level;
static PyObject *__pyx_n_s_listitems;
static PyObject *__pyx_n_u_little;
static PyObject *__pyx_n_u_load;
static PyObject *__pyx_n_u_loads;
static PyObject *__pyx_kp_u_locals;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_u_main;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_maxsize;
static PyObject *__pyx_n_s_memoize;
static PyObject *__pyx_n_u_module;
static PyObject *__pyx_n_s_modules;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_new;
static PyObject *__pyx_n_u_newobj;
static PyObject *__pyx_n_u_newobj_ex;
static PyObject *__pyx_n_b_o;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_b_p;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_persistent_id;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_kp_u_pickle_protocol_must_be_d;
static PyObject *__pyx_n_s_protocol;
static PyObject *__pyx_n_s_put;
static PyObject *__pyx_n_b_q;
static PyObject *__pyx_n_u_qualname;
static PyObject *__pyx_n_b_r;
static PyObject *__pyx_kp_u_raw_unicode_escape;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_u_reduce;
static PyObject *__pyx_n_u_reduce_ex;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_b_s;
static PyObject *__pyx_kp_u_s_must_return_string_or_tuple;
static PyObject *__pyx_n_s_save;
static PyObject *__pyx_n_s_save_bool;
static PyObject *__pyx_n_s_save_bytes;
static PyObject *__pyx_n_s_save_dict;
static PyObject *__pyx_n_s_save_float;
static PyObject *__pyx_n_s_save_frozenset;
static PyObject *__pyx_n_s_save_global;
static PyObject *__pyx_n_s_save_list;
static PyObject *__pyx_n_s_save_long;
static PyObject *__pyx_n_s_save_none;
static PyObject *__pyx_n_s_save_pers;
static PyObject *__pyx_n_s_save_persistent_id;
static PyObject *__pyx_n_s_save_reduce;
static PyObject *__pyx_n_s_save_set;
static PyObject *__pyx_n_s_save_str;
static PyObject *__pyx_n_s_save_tuple;
static PyObject *__pyx_n_s_save_type;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_signed;
static PyObject *__pyx_n_s_start_framing;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_u_surrogatepass;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_b_t;
static PyObject *__pyx_n_s_tell;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_to_bytes;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_b_u;
static PyObject *__pyx_kp_u_u000a;
static PyObject *__pyx_kp_u_u005c;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_kp_u_use_protocols_4_to_enable_suppor;
static PyObject *__pyx_kp_u_utf_8;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_x;
static int __pyx_pf_13cycloudpickle_8cypickle_7_Framer___init__(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self, PyObject *__pyx_v_file_write); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_2start_framing(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_4end_framing(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_6commit_frame(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self, int __pyx_v_force); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_8write(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static int __pyx_pf_13cycloudpickle_8cypickle_7Pickler___init__(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_protocol, PyObject *__pyx_v_fix_imports); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_2clear_memo(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_4dump(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_6memoize(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_8put(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, int __pyx_v_idx); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_10get(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_12save(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_save_persistent_id); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_14persistent_id(CYTHON_UNUSED struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_16save_pers(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_pid); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_18save_reduce(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_state, PyObject *__pyx_v_listitems, PyObject *__pyx_v_dictitems, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_20save_none(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_22save_bool(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_24save_long(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_26save_float(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_28save_bytes(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_30save_str(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_32save_tuple(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_34save_list(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_36_batch_appends(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_items); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_38save_dict(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_40_batch_setitems(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_items); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_42save_set(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_44save_frozenset(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_46save_global(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_48save_type(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_tp_new_13cycloudpickle_8cypickle__Framer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cycloudpickle_8cypickle_Pickler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_128;
static PyObject *__pyx_int_255;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_65535;
static PyObject *__pyx_int_65536;
static PyObject *__pyx_int_2147483647;
static PyObject *__pyx_int_4294967295;
static PyObject *__pyx_int_neg_2147483648;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;

/* "cycloudpickle/cypickle.pyx":159
 *     _FRAME_SIZE_TARGET = 64 * 1024
 * 
 *     def __init__(self, file_write):             # <<<<<<<<<<<<<<
 *         self.file_write = file_write
 *         self.current_frame = None
 */

/* Python wrapper */
static int __pyx_pw_13cycloudpickle_8cypickle_7_Framer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cycloudpickle_8cypickle_7_Framer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file_write = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_write,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_write)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_file_write = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7_Framer___init__(((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)__pyx_v_self), __pyx_v_file_write);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cycloudpickle_8cypickle_7_Framer___init__(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self, PyObject *__pyx_v_file_write) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cycloudpickle/cypickle.pyx":160
 * 
 *     def __init__(self, file_write):
 *         self.file_write = file_write             # <<<<<<<<<<<<<<
 *         self.current_frame = None
 * 
 */
  __Pyx_INCREF(__pyx_v_file_write);
  __Pyx_GIVEREF(__pyx_v_file_write);
  __Pyx_GOTREF(__pyx_v_self->file_write);
  __Pyx_DECREF(__pyx_v_self->file_write);
  __pyx_v_self->file_write = __pyx_v_file_write;

  /* "cycloudpickle/cypickle.pyx":161
 *     def __init__(self, file_write):
 *         self.file_write = file_write
 *         self.current_frame = None             # <<<<<<<<<<<<<<
 * 
 *     def start_framing(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->current_frame);
  __Pyx_DECREF(__pyx_v_self->current_frame);
  __pyx_v_self->current_frame = Py_None;

  /* "cycloudpickle/cypickle.pyx":159
 *     _FRAME_SIZE_TARGET = 64 * 1024
 * 
 *     def __init__(self, file_write):             # <<<<<<<<<<<<<<
 *         self.file_write = file_write
 *         self.current_frame = None
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":163
 *         self.current_frame = None
 * 
 *     def start_framing(self):             # <<<<<<<<<<<<<<
 *         self.current_frame = io.BytesIO()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_3start_framing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_3start_framing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start_framing (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7_Framer_2start_framing(((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_2start_framing(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start_framing", 0);

  /* "cycloudpickle/cypickle.pyx":164
 * 
 *     def start_framing(self):
 *         self.current_frame = io.BytesIO()             # <<<<<<<<<<<<<<
 * 
 *     def end_framing(self):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_io); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->current_frame);
  __Pyx_DECREF(__pyx_v_self->current_frame);
  __pyx_v_self->current_frame = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":163
 *         self.current_frame = None
 * 
 *     def start_framing(self):             # <<<<<<<<<<<<<<
 *         self.current_frame = io.BytesIO()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.start_framing", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":166
 *         self.current_frame = io.BytesIO()
 * 
 *     def end_framing(self):             # <<<<<<<<<<<<<<
 *         if self.current_frame and self.current_frame.tell() > 0:
 *             self.commit_frame(force=True)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_5end_framing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_5end_framing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("end_framing (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7_Framer_4end_framing(((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_4end_framing(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("end_framing", 0);

  /* "cycloudpickle/cypickle.pyx":167
 * 
 *     def end_framing(self):
 *         if self.current_frame and self.current_frame.tell() > 0:             # <<<<<<<<<<<<<<
 *             self.commit_frame(force=True)
 *             self.current_frame = None
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->current_frame); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_frame, __pyx_n_s_tell); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":168
 *     def end_framing(self):
 *         if self.current_frame and self.current_frame.tell() > 0:
 *             self.commit_frame(force=True)             # <<<<<<<<<<<<<<
 *             self.current_frame = None
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_commit_frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_force, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":169
 *         if self.current_frame and self.current_frame.tell() > 0:
 *             self.commit_frame(force=True)
 *             self.current_frame = None             # <<<<<<<<<<<<<<
 * 
 *     def commit_frame(self, bint force=False):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->current_frame);
    __Pyx_DECREF(__pyx_v_self->current_frame);
    __pyx_v_self->current_frame = Py_None;

    /* "cycloudpickle/cypickle.pyx":167
 * 
 *     def end_framing(self):
 *         if self.current_frame and self.current_frame.tell() > 0:             # <<<<<<<<<<<<<<
 *             self.commit_frame(force=True)
 *             self.current_frame = None
 */
  }

  /* "cycloudpickle/cypickle.pyx":166
 *         self.current_frame = io.BytesIO()
 * 
 *     def end_framing(self):             # <<<<<<<<<<<<<<
 *         if self.current_frame and self.current_frame.tell() > 0:
 *             self.commit_frame(force=True)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.end_framing", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":171
 *             self.current_frame = None
 * 
 *     def commit_frame(self, bint force=False):             # <<<<<<<<<<<<<<
 *         cdef int n
 *         if self.current_frame:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_7commit_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_7commit_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_force;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit_frame (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "commit_frame") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_force = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_force == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_force = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("commit_frame", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.commit_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7_Framer_6commit_frame(((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)__pyx_v_self), __pyx_v_force);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_6commit_frame(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self, int __pyx_v_force) {
  int __pyx_v_n;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("commit_frame", 0);

  /* "cycloudpickle/cypickle.pyx":173
 *     def commit_frame(self, bint force=False):
 *         cdef int n
 *         if self.current_frame:             # <<<<<<<<<<<<<<
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->current_frame); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":174
 *         cdef int n
 *         if self.current_frame:
 *             f = self.current_frame             # <<<<<<<<<<<<<<
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 *                 with f.getbuffer() as data:
 */
    __pyx_t_2 = __pyx_v_self->current_frame;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_f = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":175
 *         if self.current_frame:
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:             # <<<<<<<<<<<<<<
 *                 with f.getbuffer() as data:
 *                     n = len(data)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_FRAME_SIZE_TARGET); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_5) {
    } else {
      __pyx_t_1 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_force != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":176
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 *                 with f.getbuffer() as data:             # <<<<<<<<<<<<<<
 *                     n = len(data)
 *                     write = self.file_write
 */
      /*with:*/ {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_getbuffer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_2) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __pyx_t_3;
        __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            /*try:*/ {
              __pyx_v_data = __pyx_t_2;
              __pyx_t_2 = 0;

              /* "cycloudpickle/cypickle.pyx":177
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 *                 with f.getbuffer() as data:
 *                     n = len(data)             # <<<<<<<<<<<<<<
 *                     write = self.file_write
 *                     write(FRAME)
 */
              __pyx_t_11 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
              __pyx_v_n = __pyx_t_11;

              /* "cycloudpickle/cypickle.pyx":178
 *                 with f.getbuffer() as data:
 *                     n = len(data)
 *                     write = self.file_write             # <<<<<<<<<<<<<<
 *                     write(FRAME)
 *                     write(pack("<Q", n))
 */
              __pyx_t_2 = __pyx_v_self->file_write;
              __Pyx_INCREF(__pyx_t_2);
              __pyx_v_write = __pyx_t_2;
              __pyx_t_2 = 0;

              /* "cycloudpickle/cypickle.pyx":179
 *                     n = len(data)
 *                     write = self.file_write
 *                     write(FRAME)             # <<<<<<<<<<<<<<
 *                     write(pack("<Q", n))
 *                     write(data)
 */
              __Pyx_INCREF(__pyx_v_write);
              __pyx_t_4 = __pyx_v_write; __pyx_t_3 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_4, function);
                }
              }
              if (!__pyx_t_3) {
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_13cycloudpickle_8cypickle_FRAME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_2);
              } else {
                __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
                __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_FRAME);
                __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_FRAME);
                PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_13cycloudpickle_8cypickle_FRAME);
                __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              }
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "cycloudpickle/cypickle.pyx":180
 *                     write = self.file_write
 *                     write(FRAME)
 *                     write(pack("<Q", n))             # <<<<<<<<<<<<<<
 *                     write(data)
 *                 f.seek(0)
 */
              __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_12 = NULL;
              __pyx_t_11 = 0;
              if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
                __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
                if (likely(__pyx_t_12)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_12);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_7, function);
                  __pyx_t_11 = 1;
                }
              }
              __pyx_t_13 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
              __Pyx_GOTREF(__pyx_t_13);
              if (__pyx_t_12) {
                __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
              }
              __Pyx_INCREF(__pyx_kp_u_Q);
              __Pyx_GIVEREF(__pyx_kp_u_Q);
              PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_11, __pyx_kp_u_Q);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_11, __pyx_t_3);
              __pyx_t_3 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_INCREF(__pyx_v_write);
              __pyx_t_7 = __pyx_v_write; __pyx_t_13 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
                __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
                if (likely(__pyx_t_13)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_7, function);
                }
              }
              if (!__pyx_t_13) {
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_GOTREF(__pyx_t_2);
              } else {
                __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __pyx_t_13 = NULL;
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
                __pyx_t_4 = 0;
                __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "cycloudpickle/cypickle.pyx":181
 *                     write(FRAME)
 *                     write(pack("<Q", n))
 *                     write(data)             # <<<<<<<<<<<<<<
 *                 f.seek(0)
 *                 f.truncate()
 */
              __Pyx_INCREF(__pyx_v_write);
              __pyx_t_7 = __pyx_v_write; __pyx_t_3 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_7, function);
                }
              }
              if (!__pyx_t_3) {
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_2);
              } else {
                __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
                __Pyx_INCREF(__pyx_v_data);
                __Pyx_GIVEREF(__pyx_v_data);
                PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_data);
                __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "cycloudpickle/cypickle.pyx":176
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 *                 with f.getbuffer() as data:             # <<<<<<<<<<<<<<
 *                     n = len(data)
 *                     write = self.file_write
 */
            }
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L18_try_end;
            __pyx_L11_error:;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.commit_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (__pyx_t_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
              __pyx_t_5 = ((!(__pyx_t_1 != 0)) != 0);
              if (__pyx_t_5) {
                __Pyx_GIVEREF(__pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_7);
                __Pyx_XGIVEREF(__pyx_t_4);
                __Pyx_ErrRestore(__pyx_t_2, __pyx_t_7, __pyx_t_4);
                __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_4 = 0; 
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              goto __pyx_L12_exception_handled;
            }
            __pyx_L13_except_error:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
            goto __pyx_L1_error;
            __pyx_L12_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
            __pyx_L18_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_6) {
              __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            }
            goto __pyx_L10;
          }
          __pyx_L10:;
        }
        goto __pyx_L22;
        __pyx_L7_error:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L1_error;
        __pyx_L22:;
      }

      /* "cycloudpickle/cypickle.pyx":182
 *                     write(pack("<Q", n))
 *                     write(data)
 *                 f.seek(0)             # <<<<<<<<<<<<<<
 *                 f.truncate()
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cycloudpickle/cypickle.pyx":183
 *                     write(data)
 *                 f.seek(0)
 *                 f.truncate()             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_truncate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cycloudpickle/cypickle.pyx":175
 *         if self.current_frame:
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:             # <<<<<<<<<<<<<<
 *                 with f.getbuffer() as data:
 *                     n = len(data)
 */
    }

    /* "cycloudpickle/cypickle.pyx":173
 *     def commit_frame(self, bint force=False):
 *         cdef int n
 *         if self.current_frame:             # <<<<<<<<<<<<<<
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 */
  }

  /* "cycloudpickle/cypickle.pyx":171
 *             self.current_frame = None
 * 
 *     def commit_frame(self, bint force=False):             # <<<<<<<<<<<<<<
 *         cdef int n
 *         if self.current_frame:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.commit_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":185
 *                 f.truncate()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         if self.current_frame:
 *             return self.current_frame.write(data)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_9write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7_Framer_9write(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7_Framer_8write(((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7_Framer_8write(struct __pyx_obj_13cycloudpickle_8cypickle__Framer *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);

  /* "cycloudpickle/cypickle.pyx":186
 * 
 *     def write(self, data):
 *         if self.current_frame:             # <<<<<<<<<<<<<<
 *             return self.current_frame.write(data)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->current_frame); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":187
 *     def write(self, data):
 *         if self.current_frame:
 *             return self.current_frame.write(data)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.file_write(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_frame, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":186
 * 
 *     def write(self, data):
 *         if self.current_frame:             # <<<<<<<<<<<<<<
 *             return self.current_frame.write(data)
 *         else:
 */
  }

  /* "cycloudpickle/cypickle.pyx":189
 *             return self.current_frame.write(data)
 *         else:
 *             return self.file_write(data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->file_write);
    __pyx_t_3 = __pyx_v_self->file_write; __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_data);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cycloudpickle/cypickle.pyx":185
 *                 f.truncate()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         if self.current_frame:
 *             return self.current_frame.write(data)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cycloudpickle.cypickle._Framer.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":195
 * # Tools used for pickling.
 * 
 * cdef _getattribute(object obj, str name, bint allow_qualname=False):             # <<<<<<<<<<<<<<
 *     cdef list dotted_path = name.split(".")
 *     cdef str subpath
 */

static PyObject *__pyx_f_13cycloudpickle_8cypickle__getattribute(PyObject *__pyx_v_obj, PyObject *__pyx_v_name, struct __pyx_opt_args_13cycloudpickle_8cypickle__getattribute *__pyx_optional_args) {
  int __pyx_v_allow_qualname = ((int)0);
  PyObject *__pyx_v_dotted_path = 0;
  PyObject *__pyx_v_subpath = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getattribute", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_allow_qualname = __pyx_optional_args->allow_qualname;
    }
  }
  __Pyx_INCREF(__pyx_v_obj);

  /* "cycloudpickle/cypickle.pyx":196
 * 
 * cdef _getattribute(object obj, str name, bint allow_qualname=False):
 *     cdef list dotted_path = name.split(".")             # <<<<<<<<<<<<<<
 *     cdef str subpath
 *     if not allow_qualname and len(dotted_path) > 1:
 */
  if (unlikely(__pyx_v_name == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "split");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyUnicode_Split(__pyx_v_name, __pyx_kp_u__3, -1L); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dotted_path = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":198
 *     cdef list dotted_path = name.split(".")
 *     cdef str subpath
 *     if not allow_qualname and len(dotted_path) > 1:             # <<<<<<<<<<<<<<
 *         raise AttributeError("Can't get qualified attribute {!r} on {!r}; " +
 *                              "use protocols >= 4 to enable support"
 */
  __pyx_t_3 = ((!(__pyx_v_allow_qualname != 0)) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(__pyx_v_dotted_path == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_dotted_path); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((__pyx_t_4 > 1) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":201
 *         raise AttributeError("Can't get qualified attribute {!r} on {!r}; " +
 *                              "use protocols >= 4 to enable support"
 *                              .format(name, obj))             # <<<<<<<<<<<<<<
 *     for subpath in dotted_path:
 *         if subpath == '<locals>':
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_use_protocols_4_to_enable_suppor, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":199
 *     cdef str subpath
 *     if not allow_qualname and len(dotted_path) > 1:
 *         raise AttributeError("Can't get qualified attribute {!r} on {!r}; " +             # <<<<<<<<<<<<<<
 *                              "use protocols >= 4 to enable support"
 *                              .format(name, obj))
 */
    __pyx_t_5 = PyNumber_Add(__pyx_kp_u_Can_t_get_qualified_attribute_r, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cycloudpickle/cypickle.pyx":198
 *     cdef list dotted_path = name.split(".")
 *     cdef str subpath
 *     if not allow_qualname and len(dotted_path) > 1:             # <<<<<<<<<<<<<<
 *         raise AttributeError("Can't get qualified attribute {!r} on {!r}; " +
 *                              "use protocols >= 4 to enable support"
 */
  }

  /* "cycloudpickle/cypickle.pyx":202
 *                              "use protocols >= 4 to enable support"
 *                              .format(name, obj))
 *     for subpath in dotted_path:             # <<<<<<<<<<<<<<
 *         if subpath == '<locals>':
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 */
  if (unlikely(__pyx_v_dotted_path == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = __pyx_v_dotted_path; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_subpath, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":203
 *                              .format(name, obj))
 *     for subpath in dotted_path:
 *         if subpath == '<locals>':             # <<<<<<<<<<<<<<
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 *                                  .format(name, obj))
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_subpath, __pyx_kp_u_locals, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cycloudpickle/cypickle.pyx":205
 *         if subpath == '<locals>':
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 *                                  .format(name, obj))             # <<<<<<<<<<<<<<
 *         try:
 *             obj = getattr(obj, subpath)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Can_t_get_local_attribute_r_on_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_obj);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cycloudpickle/cypickle.pyx":204
 *     for subpath in dotted_path:
 *         if subpath == '<locals>':
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"             # <<<<<<<<<<<<<<
 *                                  .format(name, obj))
 *         try:
 */
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cycloudpickle/cypickle.pyx":203
 *                              .format(name, obj))
 *     for subpath in dotted_path:
 *         if subpath == '<locals>':             # <<<<<<<<<<<<<<
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 *                                  .format(name, obj))
 */
    }

    /* "cycloudpickle/cypickle.pyx":206
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 *                                  .format(name, obj))
 *         try:             # <<<<<<<<<<<<<<
 *             obj = getattr(obj, subpath)
 *         except AttributeError:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "cycloudpickle/cypickle.pyx":207
 *                                  .format(name, obj))
 *         try:
 *             obj = getattr(obj, subpath)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             raise AttributeError("Can't get attribute {!r} on {!r}"
 */
        __pyx_t_1 = __Pyx_GetAttr(__pyx_v_obj, __pyx_v_subpath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cycloudpickle/cypickle.pyx":206
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 *                                  .format(name, obj))
 *         try:             # <<<<<<<<<<<<<<
 *             obj = getattr(obj, subpath)
 *         except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cycloudpickle/cypickle.pyx":208
 *         try:
 *             obj = getattr(obj, subpath)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise AttributeError("Can't get attribute {!r} on {!r}"
 *                                  .format(name, obj))
 */
      __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_13) {
        __Pyx_AddTraceback("cycloudpickle.cypickle._getattribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_9);

        /* "cycloudpickle/cypickle.pyx":210
 *         except AttributeError:
 *             raise AttributeError("Can't get attribute {!r} on {!r}"
 *                                  .format(name, obj))             # <<<<<<<<<<<<<<
 *     return obj
 * 
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Can_t_get_attribute_r_on_r, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_8 = 1;
          }
        }
        __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_16);
        if (__pyx_t_15) {
          __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
        }
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_8, __pyx_v_name);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_8, __pyx_v_obj);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "cycloudpickle/cypickle.pyx":209
 *             obj = getattr(obj, subpath)
 *         except AttributeError:
 *             raise AttributeError("Can't get attribute {!r} on {!r}"             # <<<<<<<<<<<<<<
 *                                  .format(name, obj))
 *     return obj
 */
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
      }
      goto __pyx_L11_except_error;
      __pyx_L11_except_error:;

      /* "cycloudpickle/cypickle.pyx":206
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 *                                  .format(name, obj))
 *         try:             # <<<<<<<<<<<<<<
 *             obj = getattr(obj, subpath)
 *         except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L16_try_end:;
    }

    /* "cycloudpickle/cypickle.pyx":202
 *                              "use protocols >= 4 to enable support"
 *                              .format(name, obj))
 *     for subpath in dotted_path:             # <<<<<<<<<<<<<<
 *         if subpath == '<locals>':
 *             raise AttributeError("Can't get local attribute {!r} on {!r}"
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":211
 *             raise AttributeError("Can't get attribute {!r} on {!r}"
 *                                  .format(name, obj))
 *     return obj             # <<<<<<<<<<<<<<
 * 
 * cdef whichmodule(object obj, str name, bint allow_qualname=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "cycloudpickle/cypickle.pyx":195
 * # Tools used for pickling.
 * 
 * cdef _getattribute(object obj, str name, bint allow_qualname=False):             # <<<<<<<<<<<<<<
 *     cdef list dotted_path = name.split(".")
 *     cdef str subpath
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("cycloudpickle.cypickle._getattribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dotted_path);
  __Pyx_XDECREF(__pyx_v_subpath);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":213
 *     return obj
 * 
 * cdef whichmodule(object obj, str name, bint allow_qualname=False):             # <<<<<<<<<<<<<<
 *     """Find the module an object belong to."""
 *     cdef str module_name = getattr(obj, '__module__', None)
 */

static PyObject *__pyx_f_13cycloudpickle_8cypickle_whichmodule(PyObject *__pyx_v_obj, PyObject *__pyx_v_name, struct __pyx_opt_args_13cycloudpickle_8cypickle_whichmodule *__pyx_optional_args) {
  int __pyx_v_allow_qualname = ((int)0);
  PyObject *__pyx_v_module_name = 0;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  struct __pyx_opt_args_13cycloudpickle_8cypickle__getattribute __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("whichmodule", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_allow_qualname = __pyx_optional_args->allow_qualname;
    }
  }

  /* "cycloudpickle/cypickle.pyx":215
 * cdef whichmodule(object obj, str name, bint allow_qualname=False):
 *     """Find the module an object belong to."""
 *     cdef str module_name = getattr(obj, '__module__', None)             # <<<<<<<<<<<<<<
 *     if module_name is not None:
 *         return module_name
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_module, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_module_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":216
 *     """Find the module an object belong to."""
 *     cdef str module_name = getattr(obj, '__module__', None)
 *     if module_name is not None:             # <<<<<<<<<<<<<<
 *         return module_name
 *     for module_name, module in sys.modules.items():
 */
  __pyx_t_2 = (__pyx_v_module_name != ((PyObject*)Py_None));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cypickle.pyx":217
 *     cdef str module_name = getattr(obj, '__module__', None)
 *     if module_name is not None:
 *         return module_name             # <<<<<<<<<<<<<<
 *     for module_name, module in sys.modules.items():
 *         if module_name == '__main__' or module is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_module_name);
    __pyx_r = __pyx_v_module_name;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":216
 *     """Find the module an object belong to."""
 *     cdef str module_name = getattr(obj, '__module__', None)
 *     if module_name is not None:             # <<<<<<<<<<<<<<
 *         return module_name
 *     for module_name, module in sys.modules.items():
 */
  }

  /* "cycloudpickle/cypickle.pyx":218
 *     if module_name is not None:
 *         return module_name
 *     for module_name, module in sys.modules.items():             # <<<<<<<<<<<<<<
 *         if module_name == '__main__' or module is None:
 *             continue
 */
  __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modules); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(__pyx_t_8 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_8, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_7;
  __pyx_t_7 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_module_name, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_module, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cycloudpickle/cypickle.pyx":219
 *         return module_name
 *     for module_name, module in sys.modules.items():
 *         if module_name == '__main__' or module is None:             # <<<<<<<<<<<<<<
 *             continue
 *         try:
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_module_name, __pyx_n_u_main, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = (__pyx_t_2 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_3 = __pyx_t_10;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_module == Py_None);
    __pyx_t_2 = (__pyx_t_10 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_3) {

      /* "cycloudpickle/cypickle.pyx":220
 *     for module_name, module in sys.modules.items():
 *         if module_name == '__main__' or module is None:
 *             continue             # <<<<<<<<<<<<<<
 *         try:
 *             if _getattribute(module, name, allow_qualname) is obj:
 */
      goto __pyx_L4_continue;

      /* "cycloudpickle/cypickle.pyx":219
 *         return module_name
 *     for module_name, module in sys.modules.items():
 *         if module_name == '__main__' or module is None:             # <<<<<<<<<<<<<<
 *             continue
 *         try:
 */
    }

    /* "cycloudpickle/cypickle.pyx":221
 *         if module_name == '__main__' or module is None:
 *             continue
 *         try:             # <<<<<<<<<<<<<<
 *             if _getattribute(module, name, allow_qualname) is obj:
 *                 return module_name
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "cycloudpickle/cypickle.pyx":222
 *             continue
 *         try:
 *             if _getattribute(module, name, allow_qualname) is obj:             # <<<<<<<<<<<<<<
 *                 return module_name
 *         except AttributeError:
 */
        __pyx_t_14.__pyx_n = 1;
        __pyx_t_14.allow_qualname = __pyx_v_allow_qualname;
        __pyx_t_8 = __pyx_f_13cycloudpickle_8cypickle__getattribute(__pyx_v_module, __pyx_v_name, &__pyx_t_14); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = (__pyx_t_8 == __pyx_v_obj);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {

          /* "cycloudpickle/cypickle.pyx":223
 *         try:
 *             if _getattribute(module, name, allow_qualname) is obj:
 *                 return module_name             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             pass
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_module_name);
          __pyx_r = __pyx_v_module_name;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L13_try_return;

          /* "cycloudpickle/cypickle.pyx":222
 *             continue
 *         try:
 *             if _getattribute(module, name, allow_qualname) is obj:             # <<<<<<<<<<<<<<
 *                 return module_name
 *         except AttributeError:
 */
        }

        /* "cycloudpickle/cypickle.pyx":221
 *         if module_name == '__main__' or module is None:
 *             continue
 *         try:             # <<<<<<<<<<<<<<
 *             if _getattribute(module, name, allow_qualname) is obj:
 *                 return module_name
 */
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cycloudpickle/cypickle.pyx":224
 *             if _getattribute(module, name, allow_qualname) is obj:
 *                 return module_name
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             pass
 *     return '__main__'
 */
      __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_9) {
        PyErr_Restore(0,0,0);
        goto __pyx_L10_exception_handled;
      }
      goto __pyx_L11_except_error;
      __pyx_L11_except_error:;

      /* "cycloudpickle/cypickle.pyx":221
 *         if module_name == '__main__' or module is None:
 *             continue
 *         try:             # <<<<<<<<<<<<<<
 *             if _getattribute(module, name, allow_qualname) is obj:
 *                 return module_name
 */
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L13_try_return:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L0;
      __pyx_L10_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_L16_try_end:;
    }
    __pyx_L4_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":226
 *         except AttributeError:
 *             pass
 *     return '__main__'             # <<<<<<<<<<<<<<
 * 
 * cdef encode_long(x):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_u_main);
  __pyx_r = __pyx_n_u_main;
  goto __pyx_L0;

  /* "cycloudpickle/cypickle.pyx":213
 *     return obj
 * 
 * cdef whichmodule(object obj, str name, bint allow_qualname=False):             # <<<<<<<<<<<<<<
 *     """Find the module an object belong to."""
 *     cdef str module_name = getattr(obj, '__module__', None)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cypickle.whichmodule", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module_name);
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":228
 *     return '__main__'
 * 
 * cdef encode_long(x):             # <<<<<<<<<<<<<<
 *     r"""Encode a long to a two's complement little-endian binary string.
 *     Note that 0 is a special case, returning an empty string, to save a
 */

static PyObject *__pyx_f_13cycloudpickle_8cypickle_encode_long(PyObject *__pyx_v_x) {
  int __pyx_v_nbytes;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_long", 0);

  /* "cycloudpickle/cypickle.pyx":249
 *     >>>
 *     """
 *     if x == 0:             # <<<<<<<<<<<<<<
 *         return b''
 *     cdef int nbytes = (x.bit_length() >> 3) + 1
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_x, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":250
 *     """
 *     if x == 0:
 *         return b''             # <<<<<<<<<<<<<<
 *     cdef int nbytes = (x.bit_length() >> 3) + 1
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_b__4);
    __pyx_r = __pyx_kp_b__4;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":249
 *     >>>
 *     """
 *     if x == 0:             # <<<<<<<<<<<<<<
 *         return b''
 *     cdef int nbytes = (x.bit_length() >> 3) + 1
 */
  }

  /* "cycloudpickle/cypickle.pyx":251
 *     if x == 0:
 *         return b''
 *     cdef int nbytes = (x.bit_length() >> 3) + 1             # <<<<<<<<<<<<<<
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)
 *     if x < 0 and nbytes > 1:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_bit_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_RshiftObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nbytes = __pyx_t_5;

  /* "cycloudpickle/cypickle.pyx":252
 *         return b''
 *     cdef int nbytes = (x.bit_length() >> 3) + 1
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)             # <<<<<<<<<<<<<<
 *     if x < 0 and nbytes > 1:
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_byteorder, __pyx_n_u_little) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_signed, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cycloudpickle/cypickle.pyx":253
 *     cdef int nbytes = (x.bit_length() >> 3) + 1
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)
 *     if x < 0 and nbytes > 1:             # <<<<<<<<<<<<<<
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:
 *             result = result[:-1]
 */
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_7 = ((__pyx_v_nbytes > 1) != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":254
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)
 *     if x < 0 and nbytes > 1:
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:             # <<<<<<<<<<<<<<
 *             result = result[:-1]
 *     return result
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_result, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_255, 0xff, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_7) {
    } else {
      __pyx_t_2 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_result, -2L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_AndObjC(__pyx_t_3, __pyx_int_128, 0x80, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_7;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":255
 *     if x < 0 and nbytes > 1:
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:
 *             result = result[:-1]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      if (unlikely(__pyx_v_result == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PySequence_GetSlice(__pyx_v_result, 0, -1L); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":254
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)
 *     if x < 0 and nbytes > 1:
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:             # <<<<<<<<<<<<<<
 *             result = result[:-1]
 *     return result
 */
    }

    /* "cycloudpickle/cypickle.pyx":253
 *     cdef int nbytes = (x.bit_length() >> 3) + 1
 *     cdef bytes result = x.to_bytes(nbytes, byteorder='little', signed=True)
 *     if x < 0 and nbytes > 1:             # <<<<<<<<<<<<<<
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:
 *             result = result[:-1]
 */
  }

  /* "cycloudpickle/cypickle.pyx":256
 *         if result[-1] == 0xff and (result[-2] & 0x80) != 0:
 *             result = result[:-1]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cycloudpickle/cypickle.pyx":228
 *     return '__main__'
 * 
 * cdef encode_long(x):             # <<<<<<<<<<<<<<
 *     r"""Encode a long to a two's complement little-endian binary string.
 *     Note that 0 is a special case, returning an empty string, to save a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cypickle.encode_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":263
 * 
 * cdef class Pickler:
 *     def __init__(self, file, protocol=None, *, fix_imports=True):             # <<<<<<<<<<<<<<
 *         """This takes a binary file for writing a pickle data stream.
 * 
 */

/* Python wrapper */
static int __pyx_pw_13cycloudpickle_8cypickle_7Pickler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_13cycloudpickle_8cypickle_7Pickler___init__[] = "This takes a binary file for writing a pickle data stream.\n\n        The optional *protocol* argument tells the pickler to use the\n        given protocol; supported protocols are 0, 1, 2, 3 and 4.  The\n        default protocol is 3; a backward-incompatible protocol designed\n        for Python 3.\n\n        Specifying a negative protocol version selects the highest\n        protocol version supported.  The higher the protocol used, the\n        more recent the version of Python needed to read the pickle\n        produced.\n\n        The *file* argument must have a write() method that accepts a\n        single bytes argument. It can thus be a file object opened for\n        binary writing, a io.BytesIO instance, or any other custom\n        object that meets this interface.\n\n        If *fix_imports* is True and *protocol* is less than 3, pickle\n        will try to map the new Python 3 names to the old module names\n        used in Python 2, so that the pickle data stream is readable\n        with Python 2.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_13cycloudpickle_8cypickle_7Pickler___init__;
#endif
static int __pyx_pw_13cycloudpickle_8cypickle_7Pickler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_protocol = 0;
  PyObject *__pyx_v_fix_imports = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,&__pyx_n_s_protocol,&__pyx_n_s_fix_imports,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_protocol);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (kw_args == 1) {
        const Py_ssize_t index = 2;
        PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_protocol = values[1];
    __pyx_v_fix_imports = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler___init__(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), __pyx_v_file, __pyx_v_protocol, __pyx_v_fix_imports);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_13cycloudpickle_8cypickle_7Pickler___init__(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_protocol, PyObject *__pyx_v_fix_imports) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_protocol);

  /* "cycloudpickle/cypickle.pyx":286
 *         with Python 2.
 *         """
 *         if protocol is None:             # <<<<<<<<<<<<<<
 *             protocol = DEFAULT_PROTOCOL
 *         if protocol < 0:
 */
  __pyx_t_1 = (__pyx_v_protocol == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":287
 *         """
 *         if protocol is None:
 *             protocol = DEFAULT_PROTOCOL             # <<<<<<<<<<<<<<
 *         if protocol < 0:
 *             protocol = HIGHEST_PROTOCOL
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_13cycloudpickle_8cypickle_DEFAULT_PROTOCOL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_protocol, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":286
 *         with Python 2.
 *         """
 *         if protocol is None:             # <<<<<<<<<<<<<<
 *             protocol = DEFAULT_PROTOCOL
 *         if protocol < 0:
 */
  }

  /* "cycloudpickle/cypickle.pyx":288
 *         if protocol is None:
 *             protocol = DEFAULT_PROTOCOL
 *         if protocol < 0:             # <<<<<<<<<<<<<<
 *             protocol = HIGHEST_PROTOCOL
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":289
 *             protocol = DEFAULT_PROTOCOL
 *         if protocol < 0:
 *             protocol = HIGHEST_PROTOCOL             # <<<<<<<<<<<<<<
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_13cycloudpickle_8cypickle_HIGHEST_PROTOCOL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_protocol, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":288
 *         if protocol is None:
 *             protocol = DEFAULT_PROTOCOL
 *         if protocol < 0:             # <<<<<<<<<<<<<<
 *             protocol = HIGHEST_PROTOCOL
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 */
    goto __pyx_L4;
  }

  /* "cycloudpickle/cypickle.pyx":290
 *         if protocol < 0:
 *             protocol = HIGHEST_PROTOCOL
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:             # <<<<<<<<<<<<<<
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 *         try:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_int_0, __pyx_v_protocol, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_13cycloudpickle_8cypickle_HIGHEST_PROTOCOL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_protocol, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":291
 *             protocol = HIGHEST_PROTOCOL
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)             # <<<<<<<<<<<<<<
 *         try:
 *             self._file_write = file.write
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_13cycloudpickle_8cypickle_HIGHEST_PROTOCOL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_pickle_protocol_must_be_d, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cycloudpickle/cypickle.pyx":290
 *         if protocol < 0:
 *             protocol = HIGHEST_PROTOCOL
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:             # <<<<<<<<<<<<<<
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 *         try:
 */
  }
  __pyx_L4:;

  /* "cycloudpickle/cypickle.pyx":292
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 *         try:             # <<<<<<<<<<<<<<
 *             self._file_write = file.write
 *         except AttributeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cycloudpickle/cypickle.pyx":293
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 *         try:
 *             self._file_write = file.write             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             raise TypeError("file must have a 'write' attribute")
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_self->_file_write);
      __Pyx_DECREF(__pyx_v_self->_file_write);
      __pyx_v_self->_file_write = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cycloudpickle/cypickle.pyx":292
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 *         try:             # <<<<<<<<<<<<<<
 *             self._file_write = file.write
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cycloudpickle/cypickle.pyx":294
 *         try:
 *             self._file_write = file.write
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise TypeError("file must have a 'write' attribute")
 *         self.framer = _Framer(self._file_write)
 */
    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_9);

      /* "cycloudpickle/cypickle.pyx":295
 *             self._file_write = file.write
 *         except AttributeError:
 *             raise TypeError("file must have a 'write' attribute")             # <<<<<<<<<<<<<<
 *         self.framer = _Framer(self._file_write)
 *         self.write = self.framer.write
 */
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
    }
    goto __pyx_L7_except_error;
    __pyx_L7_except_error:;

    /* "cycloudpickle/cypickle.pyx":292
 *         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
 *             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
 *         try:             # <<<<<<<<<<<<<<
 *             self._file_write = file.write
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L12_try_end:;
  }

  /* "cycloudpickle/cypickle.pyx":296
 *         except AttributeError:
 *             raise TypeError("file must have a 'write' attribute")
 *         self.framer = _Framer(self._file_write)             # <<<<<<<<<<<<<<
 *         self.write = self.framer.write
 *         self.memo = {}
 */
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_self->_file_write);
  __Pyx_GIVEREF(__pyx_v_self->_file_write);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_self->_file_write);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle__Framer), __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->framer);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->framer));
  __pyx_v_self->framer = ((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":297
 *             raise TypeError("file must have a 'write' attribute")
 *         self.framer = _Framer(self._file_write)
 *         self.write = self.framer.write             # <<<<<<<<<<<<<<
 *         self.memo = {}
 *         self.proto = int(protocol)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->framer), __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->write);
  __Pyx_DECREF(__pyx_v_self->write);
  __pyx_v_self->write = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":298
 *         self.framer = _Framer(self._file_write)
 *         self.write = self.framer.write
 *         self.memo = {}             # <<<<<<<<<<<<<<
 *         self.proto = int(protocol)
 *         self.bin = protocol >= 1
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->memo);
  __Pyx_DECREF(__pyx_v_self->memo);
  __pyx_v_self->memo = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":299
 *         self.write = self.framer.write
 *         self.memo = {}
 *         self.proto = int(protocol)             # <<<<<<<<<<<<<<
 *         self.bin = protocol >= 1
 *         self.fast = 0
 */
  __pyx_t_3 = PyNumber_Int(__pyx_v_protocol); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->proto = __pyx_t_8;

  /* "cycloudpickle/cypickle.pyx":300
 *         self.memo = {}
 *         self.proto = int(protocol)
 *         self.bin = protocol >= 1             # <<<<<<<<<<<<<<
 *         self.fast = 0
 *         self.fix_imports = fix_imports and protocol < 3
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->bin = __pyx_t_1;

  /* "cycloudpickle/cypickle.pyx":301
 *         self.proto = int(protocol)
 *         self.bin = protocol >= 1
 *         self.fast = 0             # <<<<<<<<<<<<<<
 *         self.fix_imports = fix_imports and protocol < 3
 * 
 */
  __pyx_v_self->fast = 0;

  /* "cycloudpickle/cypickle.pyx":302
 *         self.bin = protocol >= 1
 *         self.fast = 0
 *         self.fix_imports = fix_imports and protocol < 3             # <<<<<<<<<<<<<<
 * 
 *     def clear_memo(self):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fix_imports); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  __pyx_v_self->fix_imports = __pyx_t_1;

  /* "cycloudpickle/cypickle.pyx":263
 * 
 * cdef class Pickler:
 *     def __init__(self, file, protocol=None, *, fix_imports=True):             # <<<<<<<<<<<<<<
 *         """This takes a binary file for writing a pickle data stream.
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_protocol);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":304
 *         self.fix_imports = fix_imports and protocol < 3
 * 
 *     def clear_memo(self):             # <<<<<<<<<<<<<<
 *         """Clears the pickler's "memo".
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_3clear_memo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_13cycloudpickle_8cypickle_7Pickler_2clear_memo[] = "Clears the pickler's \"memo\".\n\n        The memo is the data structure that remembers which objects the\n        pickler has already seen, so that shared or recursive objects\n        are pickled by reference and not by value.  This method is\n        useful when re-using picklers.\n        ";
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_3clear_memo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_memo (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_2clear_memo(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_2clear_memo(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear_memo", 0);

  /* "cycloudpickle/cypickle.pyx":312
 *         useful when re-using picklers.
 *         """
 *         self.memo.clear()             # <<<<<<<<<<<<<<
 * 
 *     def dump(self, obj):
 */
  if (unlikely(__pyx_v_self->memo == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->memo); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cycloudpickle/cypickle.pyx":304
 *         self.fix_imports = fix_imports and protocol < 3
 * 
 *     def clear_memo(self):             # <<<<<<<<<<<<<<
 *         """Clears the pickler's "memo".
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.clear_memo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":314
 *         self.memo.clear()
 * 
 *     def dump(self, obj):             # <<<<<<<<<<<<<<
 *         """Write a pickled representation of obj to the open file."""
 *         if self.proto >= 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_5dump(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_8cypickle_7Pickler_4dump[] = "Write a pickled representation of obj to the open file.";
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_5dump(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dump (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_4dump(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_4dump(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 0);

  /* "cycloudpickle/cypickle.pyx":316
 *     def dump(self, obj):
 *         """Write a pickled representation of obj to the open file."""
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             self.write(PROTO + pack("<B", self.proto))
 *         if self.proto >= 4:
 */
  __pyx_t_1 = ((__pyx_v_self->proto >= 2) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":317
 *         """Write a pickled representation of obj to the open file."""
 *         if self.proto >= 2:
 *             self.write(PROTO + pack("<B", self.proto))             # <<<<<<<<<<<<<<
 *         if self.proto >= 4:
 *             self.framer.start_framing()
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->proto); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_B);
    __Pyx_GIVEREF(__pyx_kp_u_B);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_B);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_PROTO, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_3 = __pyx_v_self->write; __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":316
 *     def dump(self, obj):
 *         """Write a pickled representation of obj to the open file."""
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             self.write(PROTO + pack("<B", self.proto))
 *         if self.proto >= 4:
 */
  }

  /* "cycloudpickle/cypickle.pyx":318
 *         if self.proto >= 2:
 *             self.write(PROTO + pack("<B", self.proto))
 *         if self.proto >= 4:             # <<<<<<<<<<<<<<
 *             self.framer.start_framing()
 *         self.save(obj)
 */
  __pyx_t_1 = ((__pyx_v_self->proto >= 4) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":319
 *             self.write(PROTO + pack("<B", self.proto))
 *         if self.proto >= 4:
 *             self.framer.start_framing()             # <<<<<<<<<<<<<<
 *         self.save(obj)
 *         self.write(STOP)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->framer), __pyx_n_s_start_framing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":318
 *         if self.proto >= 2:
 *             self.write(PROTO + pack("<B", self.proto))
 *         if self.proto >= 4:             # <<<<<<<<<<<<<<
 *             self.framer.start_framing()
 *         self.save(obj)
 */
  }

  /* "cycloudpickle/cypickle.pyx":320
 *         if self.proto >= 4:
 *             self.framer.start_framing()
 *         self.save(obj)             # <<<<<<<<<<<<<<
 *         self.write(STOP)
 *         self.framer.end_framing()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":321
 *             self.framer.start_framing()
 *         self.save(obj)
 *         self.write(STOP)             # <<<<<<<<<<<<<<
 *         self.framer.end_framing()
 * 
 */
  __Pyx_INCREF(__pyx_v_self->write);
  __pyx_t_3 = __pyx_v_self->write; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_13cycloudpickle_8cypickle_STOP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_STOP);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_STOP);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_13cycloudpickle_8cypickle_STOP);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":322
 *         self.save(obj)
 *         self.write(STOP)
 *         self.framer.end_framing()             # <<<<<<<<<<<<<<
 * 
 *     def memoize(self, obj):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->framer), __pyx_n_s_end_framing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":314
 *         self.memo.clear()
 * 
 *     def dump(self, obj):             # <<<<<<<<<<<<<<
 *         """Write a pickled representation of obj to the open file."""
 *         if self.proto >= 2:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":324
 *         self.framer.end_framing()
 * 
 *     def memoize(self, obj):             # <<<<<<<<<<<<<<
 *         """Store an object in the memo."""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_7memoize(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_8cypickle_7Pickler_6memoize[] = "Store an object in the memo.";
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_7memoize(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("memoize (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_6memoize(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_6memoize(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_v_idx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoize", 0);

  /* "cycloudpickle/cypickle.pyx":339
 *         # scheme allows the Unpickler memo to be implemented as a plain (but
 *         # growable) array, indexed by memo key.
 *         if self.fast:             # <<<<<<<<<<<<<<
 *             return
 *         assert id(obj) not in self.memo
 */
  __pyx_t_1 = (__pyx_v_self->fast != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":340
 *         # growable) array, indexed by memo key.
 *         if self.fast:
 *             return             # <<<<<<<<<<<<<<
 *         assert id(obj) not in self.memo
 *         cdef int idx = len(self.memo)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":339
 *         # scheme allows the Unpickler memo to be implemented as a plain (but
 *         # growable) array, indexed by memo key.
 *         if self.fast:             # <<<<<<<<<<<<<<
 *             return
 *         assert id(obj) not in self.memo
 */
  }

  /* "cycloudpickle/cypickle.pyx":341
 *         if self.fast:
 *             return
 *         assert id(obj) not in self.memo             # <<<<<<<<<<<<<<
 *         cdef int idx = len(self.memo)
 *         self.write(self.put(idx))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_v_self->memo == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_self->memo, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "cycloudpickle/cypickle.pyx":342
 *             return
 *         assert id(obj) not in self.memo
 *         cdef int idx = len(self.memo)             # <<<<<<<<<<<<<<
 *         self.write(self.put(idx))
 *         self.memo[id(obj)] = idx, obj
 */
  __pyx_t_3 = __pyx_v_self->memo;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_idx = __pyx_t_4;

  /* "cycloudpickle/cypickle.pyx":343
 *         assert id(obj) not in self.memo
 *         cdef int idx = len(self.memo)
 *         self.write(self.put(idx))             # <<<<<<<<<<<<<<
 *         self.memo[id(obj)] = idx, obj
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_v_self->write);
  __pyx_t_5 = __pyx_v_self->write; __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":344
 *         cdef int idx = len(self.memo)
 *         self.write(self.put(idx))
 *         self.memo[id(obj)] = idx, obj             # <<<<<<<<<<<<<<
 * 
 *     # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_obj);
  __pyx_t_3 = 0;
  if (unlikely(__pyx_v_self->memo == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(PyDict_SetItem(__pyx_v_self->memo, __pyx_t_6, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":324
 *         self.framer.end_framing()
 * 
 *     def memoize(self, obj):             # <<<<<<<<<<<<<<
 *         """Store an object in the memo."""
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.memoize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":347
 * 
 *     # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
 *     def put(self, int idx):             # <<<<<<<<<<<<<<
 *         if self.proto >= 4:
 *             return MEMOIZE
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_9put(PyObject *__pyx_v_self, PyObject *__pyx_arg_idx); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_9put(PyObject *__pyx_v_self, PyObject *__pyx_arg_idx) {
  int __pyx_v_idx;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  assert(__pyx_arg_idx); {
    __pyx_v_idx = __Pyx_PyInt_As_int(__pyx_arg_idx); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_8put(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((int)__pyx_v_idx));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_8put(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, int __pyx_v_idx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);

  /* "cycloudpickle/cypickle.pyx":348
 *     # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
 *     def put(self, int idx):
 *         if self.proto >= 4:             # <<<<<<<<<<<<<<
 *             return MEMOIZE
 *         elif self.bin:
 */
  __pyx_t_1 = ((__pyx_v_self->proto >= 4) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":349
 *     def put(self, int idx):
 *         if self.proto >= 4:
 *             return MEMOIZE             # <<<<<<<<<<<<<<
 *         elif self.bin:
 *             if idx < 256:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_MEMOIZE);
    __pyx_r = __pyx_v_13cycloudpickle_8cypickle_MEMOIZE;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":348
 *     # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
 *     def put(self, int idx):
 *         if self.proto >= 4:             # <<<<<<<<<<<<<<
 *             return MEMOIZE
 *         elif self.bin:
 */
  }

  /* "cycloudpickle/cypickle.pyx":350
 *         if self.proto >= 4:
 *             return MEMOIZE
 *         elif self.bin:             # <<<<<<<<<<<<<<
 *             if idx < 256:
 *                 return BINPUT + pack("<B", idx)
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":351
 *             return MEMOIZE
 *         elif self.bin:
 *             if idx < 256:             # <<<<<<<<<<<<<<
 *                 return BINPUT + pack("<B", idx)
 *             else:
 */
    __pyx_t_1 = ((__pyx_v_idx < 0x100) != 0);
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":352
 *         elif self.bin:
 *             if idx < 256:
 *                 return BINPUT + pack("<B", idx)             # <<<<<<<<<<<<<<
 *             else:
 *                 return LONG_BINPUT + pack("<I", idx)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_kp_u_B);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINPUT, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":351
 *             return MEMOIZE
 *         elif self.bin:
 *             if idx < 256:             # <<<<<<<<<<<<<<
 *                 return BINPUT + pack("<B", idx)
 *             else:
 */
    }

    /* "cycloudpickle/cypickle.pyx":354
 *                 return BINPUT + pack("<B", idx)
 *             else:
 *                 return LONG_BINPUT + pack("<I", idx)             # <<<<<<<<<<<<<<
 *         else:
 *             return PUT + repr(idx).encode("ascii") + b'\n'
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_I);
      __Pyx_GIVEREF(__pyx_kp_u_I);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_u_I);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_LONG_BINPUT, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cycloudpickle/cypickle.pyx":350
 *         if self.proto >= 4:
 *             return MEMOIZE
 *         elif self.bin:             # <<<<<<<<<<<<<<
 *             if idx < 256:
 *                 return BINPUT + pack("<B", idx)
 */
  }

  /* "cycloudpickle/cypickle.pyx":356
 *                 return LONG_BINPUT + pack("<I", idx)
 *         else:
 *             return PUT + repr(idx).encode("ascii") + b'\n'             # <<<<<<<<<<<<<<
 * 
 *     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_PUT, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cycloudpickle/cypickle.pyx":347
 * 
 *     # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
 *     def put(self, int idx):             # <<<<<<<<<<<<<<
 *         if self.proto >= 4:
 *             return MEMOIZE
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":359
 * 
 *     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
 *     def get(self, int i):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             if i < 256:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_11get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_11get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_10get(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_10get(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, int __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "cycloudpickle/cypickle.pyx":360
 *     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
 *     def get(self, int i):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             if i < 256:
 *                 return BINGET + pack("<B", i)
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":361
 *     def get(self, int i):
 *         if self.bin:
 *             if i < 256:             # <<<<<<<<<<<<<<
 *                 return BINGET + pack("<B", i)
 *             else:
 */
    __pyx_t_1 = ((__pyx_v_i < 0x100) != 0);
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":362
 *         if self.bin:
 *             if i < 256:
 *                 return BINGET + pack("<B", i)             # <<<<<<<<<<<<<<
 *             else:
 *                 return LONG_BINGET + pack("<I", i)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_kp_u_B);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINGET, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":361
 *     def get(self, int i):
 *         if self.bin:
 *             if i < 256:             # <<<<<<<<<<<<<<
 *                 return BINGET + pack("<B", i)
 *             else:
 */
    }

    /* "cycloudpickle/cypickle.pyx":364
 *                 return BINGET + pack("<B", i)
 *             else:
 *                 return LONG_BINGET + pack("<I", i)             # <<<<<<<<<<<<<<
 * 
 *         return GET + repr(i).encode("ascii") + b'\n'
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_I);
      __Pyx_GIVEREF(__pyx_kp_u_I);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_u_I);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_LONG_BINGET, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cycloudpickle/cypickle.pyx":360
 *     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
 *     def get(self, int i):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             if i < 256:
 *                 return BINGET + pack("<B", i)
 */
  }

  /* "cycloudpickle/cypickle.pyx":366
 *                 return LONG_BINGET + pack("<I", i)
 * 
 *         return GET + repr(i).encode("ascii") + b'\n'             # <<<<<<<<<<<<<<
 * 
 *     def save(self, object obj, bint save_persistent_id=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_GET, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cypickle.pyx":359
 * 
 *     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
 *     def get(self, int i):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             if i < 256:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":368
 *         return GET + repr(i).encode("ascii") + b'\n'
 * 
 *     def save(self, object obj, bint save_persistent_id=True):             # <<<<<<<<<<<<<<
 *         self.framer.commit_frame()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_13save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_13save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_save_persistent_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_save_persistent_id,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_save_persistent_id);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    if (values[1]) {
      __pyx_v_save_persistent_id = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_save_persistent_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_save_persistent_id = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_12save(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), __pyx_v_obj, __pyx_v_save_persistent_id);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_12save(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_save_persistent_id) {
  PyObject *__pyx_v_pid = NULL;
  PyObject *__pyx_v_x = NULL;
  PyTypeObject *__pyx_v_t = 0;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_reduce = NULL;
  PyObject *__pyx_v_rv = NULL;
  int __pyx_v_issc;
  Py_ssize_t __pyx_v_l;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save", 0);

  /* "cycloudpickle/cypickle.pyx":369
 * 
 *     def save(self, object obj, bint save_persistent_id=True):
 *         self.framer.commit_frame()             # <<<<<<<<<<<<<<
 * 
 *         # Check for persistent id (defined by a subclass)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->framer), __pyx_n_s_commit_frame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":372
 * 
 *         # Check for persistent id (defined by a subclass)
 *         pid = self.persistent_id(obj)             # <<<<<<<<<<<<<<
 *         if pid is not None and save_persistent_id:
 *             self.save_pers(pid)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_persistent_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":373
 *         # Check for persistent id (defined by a subclass)
 *         pid = self.persistent_id(obj)
 *         if pid is not None and save_persistent_id:             # <<<<<<<<<<<<<<
 *             self.save_pers(pid)
 *             return
 */
  __pyx_t_6 = (__pyx_v_pid != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_save_persistent_id != 0);
  __pyx_t_5 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":374
 *         pid = self.persistent_id(obj)
 *         if pid is not None and save_persistent_id:
 *             self.save_pers(pid)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_pers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_pid);
      __Pyx_GIVEREF(__pyx_v_pid);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_pid);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":375
 *         if pid is not None and save_persistent_id:
 *             self.save_pers(pid)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Check the memo
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":373
 *         # Check for persistent id (defined by a subclass)
 *         pid = self.persistent_id(obj)
 *         if pid is not None and save_persistent_id:             # <<<<<<<<<<<<<<
 *             self.save_pers(pid)
 *             return
 */
  }

  /* "cycloudpickle/cypickle.pyx":378
 * 
 *         # Check the memo
 *         x = self.memo.get(id(obj))             # <<<<<<<<<<<<<<
 *         if x is not None:
 *             self.write(self.get(x[0]))
 */
  if (unlikely(__pyx_v_self->memo == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->memo, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":379
 *         # Check the memo
 *         x = self.memo.get(id(obj))
 *         if x is not None:             # <<<<<<<<<<<<<<
 *             self.write(self.get(x[0]))
 *             return
 */
  __pyx_t_5 = (__pyx_v_x != Py_None);
  __pyx_t_7 = (__pyx_t_5 != 0);
  if (__pyx_t_7) {

    /* "cycloudpickle/cypickle.pyx":380
 *         x = self.memo.get(id(obj))
 *         if x is not None:
 *             self.write(self.get(x[0]))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_3 = __pyx_v_self->write; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":381
 *         if x is not None:
 *             self.write(self.get(x[0]))
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Check the type dispatch table
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":379
 *         # Check the memo
 *         x = self.memo.get(id(obj))
 *         if x is not None:             # <<<<<<<<<<<<<<
 *             self.write(self.get(x[0]))
 *             return
 */
  }

  /* "cycloudpickle/cypickle.pyx":384
 * 
 *         # Check the type dispatch table
 *         cdef type t = type(obj)             # <<<<<<<<<<<<<<
 *         f = self.dispatch.get(t)
 *         if f is not None:
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
  __pyx_v_t = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_obj)));

  /* "cycloudpickle/cypickle.pyx":385
 *         # Check the type dispatch table
 *         cdef type t = type(obj)
 *         f = self.dispatch.get(t)             # <<<<<<<<<<<<<<
 *         if f is not None:
 *             f(self, obj)  # Call unbound method with explicit self
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_t));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_t));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_t));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":386
 *         cdef type t = type(obj)
 *         f = self.dispatch.get(t)
 *         if f is not None:             # <<<<<<<<<<<<<<
 *             f(self, obj)  # Call unbound method with explicit self
 *             return
 */
  __pyx_t_7 = (__pyx_v_f != Py_None);
  __pyx_t_5 = (__pyx_t_7 != 0);
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":387
 *         f = self.dispatch.get(t)
 *         if f is not None:
 *             f(self, obj)  # Call unbound method with explicit self             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_INCREF(__pyx_v_f);
    __pyx_t_4 = __pyx_v_f; __pyx_t_2 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_10 = 1;
      }
    }
    __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":388
 *         if f is not None:
 *             f(self, obj)  # Call unbound method with explicit self
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Check private dispatch table if any, or else copyreg.dispatch_table
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":386
 *         cdef type t = type(obj)
 *         f = self.dispatch.get(t)
 *         if f is not None:             # <<<<<<<<<<<<<<
 *             f(self, obj)  # Call unbound method with explicit self
 *             return
 */
  }

  /* "cycloudpickle/cypickle.pyx":391
 * 
 *         # Check private dispatch table if any, or else copyreg.dispatch_table
 *         reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)             # <<<<<<<<<<<<<<
 *         if reduce is not None:
 *             rv = reduce(obj)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_dispatch_table); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_u_dispatch_table, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_t));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_t));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_t));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_reduce = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":392
 *         # Check private dispatch table if any, or else copyreg.dispatch_table
 *         reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)
 *         if reduce is not None:             # <<<<<<<<<<<<<<
 *             rv = reduce(obj)
 *         else:
 */
  __pyx_t_5 = (__pyx_v_reduce != Py_None);
  __pyx_t_7 = (__pyx_t_5 != 0);
  if (__pyx_t_7) {

    /* "cycloudpickle/cypickle.pyx":393
 *         reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)
 *         if reduce is not None:
 *             rv = reduce(obj)             # <<<<<<<<<<<<<<
 *         else:
 *             # Check for a class with a custom metaclass; treat as regular class
 */
    __Pyx_INCREF(__pyx_v_reduce);
    __pyx_t_4 = __pyx_v_reduce; __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_rv = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":392
 *         # Check private dispatch table if any, or else copyreg.dispatch_table
 *         reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)
 *         if reduce is not None:             # <<<<<<<<<<<<<<
 *             rv = reduce(obj)
 *         else:
 */
    goto __pyx_L8;
  }

  /* "cycloudpickle/cypickle.pyx":396
 *         else:
 *             # Check for a class with a custom metaclass; treat as regular class
 *             try:             # <<<<<<<<<<<<<<
 *                 issc = issubclass(t, type)
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 */
  /*else*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "cycloudpickle/cypickle.pyx":397
 *             # Check for a class with a custom metaclass; treat as regular class
 *             try:
 *                 issc = issubclass(t, type)             # <<<<<<<<<<<<<<
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 *                 issc = False
 */
        __pyx_t_7 = PyObject_IsSubclass(((PyObject *)__pyx_v_t), ((PyObject *)(&PyType_Type))); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __pyx_v_issc = __pyx_t_7;

        /* "cycloudpickle/cypickle.pyx":396
 *         else:
 *             # Check for a class with a custom metaclass; treat as regular class
 *             try:             # <<<<<<<<<<<<<<
 *                 issc = issubclass(t, type)
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 */
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cycloudpickle/cypickle.pyx":398
 *             try:
 *                 issc = issubclass(t, type)
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)             # <<<<<<<<<<<<<<
 *                 issc = False
 *             if issc:
 */
      __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_14) {
        __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_3);

        /* "cycloudpickle/cypickle.pyx":399
 *                 issc = issubclass(t, type)
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 *                 issc = False             # <<<<<<<<<<<<<<
 *             if issc:
 *                 self.save_global(obj)
 */
        __pyx_v_issc = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L10_exception_handled;
      }
      goto __pyx_L11_except_error;
      __pyx_L11_except_error:;

      /* "cycloudpickle/cypickle.pyx":396
 *         else:
 *             # Check for a class with a custom metaclass; treat as regular class
 *             try:             # <<<<<<<<<<<<<<
 *                 issc = issubclass(t, type)
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 */
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L10_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_L16_try_end:;
    }

    /* "cycloudpickle/cypickle.pyx":400
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 *                 issc = False
 *             if issc:             # <<<<<<<<<<<<<<
 *                 self.save_global(obj)
 *                 return
 */
    __pyx_t_7 = (__pyx_v_issc != 0);
    if (__pyx_t_7) {

      /* "cycloudpickle/cypickle.pyx":401
 *                 issc = False
 *             if issc:
 *                 self.save_global(obj)             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_global); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_obj);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":402
 *             if issc:
 *                 self.save_global(obj)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             # Check for a __reduce_ex__ method, fall back to __reduce__
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":400
 *             except TypeError:  # t is not a class (old Boost; see SF #502085)
 *                 issc = False
 *             if issc:             # <<<<<<<<<<<<<<
 *                 self.save_global(obj)
 *                 return
 */
    }

    /* "cycloudpickle/cypickle.pyx":405
 * 
 *             # Check for a __reduce_ex__ method, fall back to __reduce__
 *             reduce = getattr(obj, "__reduce_ex__", None)             # <<<<<<<<<<<<<<
 *             if reduce is not None:
 *                 rv = reduce(self.proto)
 */
    __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_reduce_ex, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_reduce, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":406
 *             # Check for a __reduce_ex__ method, fall back to __reduce__
 *             reduce = getattr(obj, "__reduce_ex__", None)
 *             if reduce is not None:             # <<<<<<<<<<<<<<
 *                 rv = reduce(self.proto)
 *             else:
 */
    __pyx_t_7 = (__pyx_v_reduce != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    if (__pyx_t_5) {

      /* "cycloudpickle/cypickle.pyx":407
 *             reduce = getattr(obj, "__reduce_ex__", None)
 *             if reduce is not None:
 *                 rv = reduce(self.proto)             # <<<<<<<<<<<<<<
 *             else:
 *                 reduce = getattr(obj, "__reduce__", None)
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->proto); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_reduce);
      __pyx_t_2 = __pyx_v_reduce; __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_rv = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":406
 *             # Check for a __reduce_ex__ method, fall back to __reduce__
 *             reduce = getattr(obj, "__reduce_ex__", None)
 *             if reduce is not None:             # <<<<<<<<<<<<<<
 *                 rv = reduce(self.proto)
 *             else:
 */
      goto __pyx_L20;
    }

    /* "cycloudpickle/cypickle.pyx":409
 *                 rv = reduce(self.proto)
 *             else:
 *                 reduce = getattr(obj, "__reduce__", None)             # <<<<<<<<<<<<<<
 *                 if reduce is not None:
 *                     rv = reduce()
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_reduce, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_reduce, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":410
 *             else:
 *                 reduce = getattr(obj, "__reduce__", None)
 *                 if reduce is not None:             # <<<<<<<<<<<<<<
 *                     rv = reduce()
 *                 else:
 */
      __pyx_t_5 = (__pyx_v_reduce != Py_None);
      __pyx_t_7 = (__pyx_t_5 != 0);
      if (__pyx_t_7) {

        /* "cycloudpickle/cypickle.pyx":411
 *                 reduce = getattr(obj, "__reduce__", None)
 *                 if reduce is not None:
 *                     rv = reduce()             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r object: %r" %
 */
        __Pyx_INCREF(__pyx_v_reduce);
        __pyx_t_2 = __pyx_v_reduce; __pyx_t_9 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (__pyx_t_9) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_rv = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "cycloudpickle/cypickle.pyx":410
 *             else:
 *                 reduce = getattr(obj, "__reduce__", None)
 *                 if reduce is not None:             # <<<<<<<<<<<<<<
 *                     rv = reduce()
 *                 else:
 */
        goto __pyx_L21;
      }

      /* "cycloudpickle/cypickle.pyx":413
 *                     rv = reduce()
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r object: %r" %             # <<<<<<<<<<<<<<
 *                                         (t.__name__, obj))
 * 
 */
      /*else*/ {
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cycloudpickle/cypickle.pyx":414
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r object: %r" %
 *                                         (t.__name__, obj))             # <<<<<<<<<<<<<<
 * 
 *         # Check for string returned by reduce(), meaning "save as global"
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_t), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_obj);
        __pyx_t_2 = 0;

        /* "cycloudpickle/cypickle.pyx":413
 *                     rv = reduce()
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r object: %r" %             # <<<<<<<<<<<<<<
 *                                         (t.__name__, obj))
 * 
 */
        __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Can_t_pickle_r_object_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L21:;
    }
    __pyx_L20:;
  }
  __pyx_L8:;

  /* "cycloudpickle/cypickle.pyx":417
 * 
 *         # Check for string returned by reduce(), meaning "save as global"
 *         if isinstance(rv, str):             # <<<<<<<<<<<<<<
 *             self.save_global(obj, rv)
 *             return
 */
  __pyx_t_7 = PyUnicode_Check(__pyx_v_rv); 
  __pyx_t_5 = (__pyx_t_7 != 0);
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":418
 *         # Check for string returned by reduce(), meaning "save as global"
 *         if isinstance(rv, str):
 *             self.save_global(obj, rv)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_global); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_10 = 1;
      }
    }
    __pyx_t_2 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_10, __pyx_v_obj);
    __Pyx_INCREF(__pyx_v_rv);
    __Pyx_GIVEREF(__pyx_v_rv);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_10, __pyx_v_rv);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":419
 *         if isinstance(rv, str):
 *             self.save_global(obj, rv)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Assert that reduce() returned a tuple
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":417
 * 
 *         # Check for string returned by reduce(), meaning "save as global"
 *         if isinstance(rv, str):             # <<<<<<<<<<<<<<
 *             self.save_global(obj, rv)
 *             return
 */
  }

  /* "cycloudpickle/cypickle.pyx":422
 * 
 *         # Assert that reduce() returned a tuple
 *         if not isinstance(rv, tuple):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("%s must return string or tuple" % reduce)
 * 
 */
  __pyx_t_5 = PyTuple_Check(__pyx_v_rv); 
  __pyx_t_7 = ((!(__pyx_t_5 != 0)) != 0);
  if (__pyx_t_7) {

    /* "cycloudpickle/cypickle.pyx":423
 *         # Assert that reduce() returned a tuple
 *         if not isinstance(rv, tuple):
 *             raise pickle.PicklingError("%s must return string or tuple" % reduce)             # <<<<<<<<<<<<<<
 * 
 *         # Assert that it returned an appropriately sized tuple
 */
    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_s_must_return_string_or_tuple, __pyx_v_reduce); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cycloudpickle/cypickle.pyx":422
 * 
 *         # Assert that reduce() returned a tuple
 *         if not isinstance(rv, tuple):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("%s must return string or tuple" % reduce)
 * 
 */
  }

  /* "cycloudpickle/cypickle.pyx":426
 * 
 *         # Assert that it returned an appropriately sized tuple
 *         l = len(rv)             # <<<<<<<<<<<<<<
 *         if not (2 <= l <= 5):
 *             raise pickle.PicklingError("Tuple returned by %s must have "
 */
  __pyx_t_10 = PyObject_Length(__pyx_v_rv); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_l = __pyx_t_10;

  /* "cycloudpickle/cypickle.pyx":427
 *         # Assert that it returned an appropriately sized tuple
 *         l = len(rv)
 *         if not (2 <= l <= 5):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Tuple returned by %s must have "
 *                                 "two to five elements" % reduce)
 */
  __pyx_t_7 = (2 <= __pyx_v_l);
  if (__pyx_t_7) {
    __pyx_t_7 = (__pyx_v_l <= 5);
  }
  __pyx_t_5 = ((!(__pyx_t_7 != 0)) != 0);
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":428
 *         l = len(rv)
 *         if not (2 <= l <= 5):
 *             raise pickle.PicklingError("Tuple returned by %s must have "             # <<<<<<<<<<<<<<
 *                                 "two to five elements" % reduce)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":429
 *         if not (2 <= l <= 5):
 *             raise pickle.PicklingError("Tuple returned by %s must have "
 *                                 "two to five elements" % reduce)             # <<<<<<<<<<<<<<
 * 
 *         # Save the reduce() output and finally memoize the object
 */
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Tuple_returned_by_s_must_have_tw, __pyx_v_reduce); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cycloudpickle/cypickle.pyx":427
 *         # Assert that it returned an appropriately sized tuple
 *         l = len(rv)
 *         if not (2 <= l <= 5):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Tuple returned by %s must have "
 *                                 "two to five elements" % reduce)
 */
  }

  /* "cycloudpickle/cypickle.pyx":432
 * 
 *         # Save the reduce() output and finally memoize the object
 *         self.save_reduce(obj=obj, *rv)             # <<<<<<<<<<<<<<
 * 
 *     def persistent_id(self, obj):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PySequence_Tuple(__pyx_v_rv); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":368
 *         return GET + repr(i).encode("ascii") + b'\n'
 * 
 *     def save(self, object obj, bint save_persistent_id=True):             # <<<<<<<<<<<<<<
 *         self.framer.commit_frame()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pid);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_reduce);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":434
 *         self.save_reduce(obj=obj, *rv)
 * 
 *     def persistent_id(self, obj):             # <<<<<<<<<<<<<<
 *         # This exists so a subclass can override it
 *         return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_15persistent_id(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_15persistent_id(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("persistent_id (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_14persistent_id(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_14persistent_id(CYTHON_UNUSED struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("persistent_id", 0);

  /* "cycloudpickle/cypickle.pyx":436
 *     def persistent_id(self, obj):
 *         # This exists so a subclass can override it
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def save_pers(self, pid):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "cycloudpickle/cypickle.pyx":434
 *         self.save_reduce(obj=obj, *rv)
 * 
 *     def persistent_id(self, obj):             # <<<<<<<<<<<<<<
 *         # This exists so a subclass can override it
 *         return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":438
 *         return None
 * 
 *     def save_pers(self, pid):             # <<<<<<<<<<<<<<
 *         # Save a persistent id reference
 *         if self.bin:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_17save_pers(PyObject *__pyx_v_self, PyObject *__pyx_v_pid); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_17save_pers(PyObject *__pyx_v_self, PyObject *__pyx_v_pid) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_pers (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_16save_pers(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_pid));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_16save_pers(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_pid) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_pers", 0);

  /* "cycloudpickle/cypickle.pyx":440
 *     def save_pers(self, pid):
 *         # Save a persistent id reference
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.save(pid, save_persistent_id=False)
 *             self.write(BINPERSID)
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":441
 *         # Save a persistent id reference
 *         if self.bin:
 *             self.save(pid, save_persistent_id=False)             # <<<<<<<<<<<<<<
 *             self.write(BINPERSID)
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_pid);
    __Pyx_GIVEREF(__pyx_v_pid);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pid);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_save_persistent_id, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":442
 *         if self.bin:
 *             self.save(pid, save_persistent_id=False)
 *             self.write(BINPERSID)             # <<<<<<<<<<<<<<
 *         else:
 *             self.write(PERSID + str(pid).encode("ascii") + b'\n')
 */
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_4 = __pyx_v_self->write; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_13cycloudpickle_8cypickle_BINPERSID); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_BINPERSID);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_BINPERSID);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_13cycloudpickle_8cypickle_BINPERSID);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":440
 *     def save_pers(self, pid):
 *         # Save a persistent id reference
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.save(pid, save_persistent_id=False)
 *             self.write(BINPERSID)
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cypickle.pyx":444
 *             self.write(BINPERSID)
 *         else:
 *             self.write(PERSID + str(pid).encode("ascii") + b'\n')             # <<<<<<<<<<<<<<
 * 
 *     def save_reduce(self, func, args, state=None, listitems=None,
 */
  /*else*/ {
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_pid);
    __Pyx_GIVEREF(__pyx_v_pid);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pid);
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_PERSID, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_2 = __pyx_v_self->write; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cypickle.pyx":438
 *         return None
 * 
 *     def save_pers(self, pid):             # <<<<<<<<<<<<<<
 *         # Save a persistent id reference
 *         if self.bin:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_pers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":446
 *             self.write(PERSID + str(pid).encode("ascii") + b'\n')
 * 
 *     def save_reduce(self, func, args, state=None, listitems=None,             # <<<<<<<<<<<<<<
 *                     dictitems=None, obj=None):
 *         # This API is called by some subclasses
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_19save_reduce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_19save_reduce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v_listitems = 0;
  PyObject *__pyx_v_dictitems = 0;
  PyObject *__pyx_v_obj = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_reduce (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_state,&__pyx_n_s_listitems,&__pyx_n_s_dictitems,&__pyx_n_s_obj,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);

    /* "cycloudpickle/cypickle.pyx":447
 * 
 *     def save_reduce(self, func, args, state=None, listitems=None,
 *                     dictitems=None, obj=None):             # <<<<<<<<<<<<<<
 *         # This API is called by some subclasses
 * 
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("save_reduce", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_listitems);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dictitems);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save_reduce") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_func = values[0];
    __pyx_v_args = values[1];
    __pyx_v_state = values[2];
    __pyx_v_listitems = values[3];
    __pyx_v_dictitems = values[4];
    __pyx_v_obj = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_reduce", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_18save_reduce(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), __pyx_v_func, __pyx_v_args, __pyx_v_state, __pyx_v_listitems, __pyx_v_dictitems, __pyx_v_obj);

  /* "cycloudpickle/cypickle.pyx":446
 *             self.write(PERSID + str(pid).encode("ascii") + b'\n')
 * 
 *     def save_reduce(self, func, args, state=None, listitems=None,             # <<<<<<<<<<<<<<
 *                     dictitems=None, obj=None):
 *         # This API is called by some subclasses
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_18save_reduce(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_state, PyObject *__pyx_v_listitems, PyObject *__pyx_v_dictitems, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_func_name = 0;
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_reduce", 0);
  __Pyx_INCREF(__pyx_v_args);

  /* "cycloudpickle/cypickle.pyx":450
 *         # This API is called by some subclasses
 * 
 *         if not isinstance(args, tuple):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")
 *         if not callable(func):
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_args); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":451
 * 
 *         if not isinstance(args, tuple):
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")             # <<<<<<<<<<<<<<
 *         if not callable(func):
 *             raise pickle.PicklingError("func from save_reduce() must be callable")
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cycloudpickle/cypickle.pyx":450
 *         # This API is called by some subclasses
 * 
 *         if not isinstance(args, tuple):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")
 *         if not callable(func):
 */
  }

  /* "cycloudpickle/cypickle.pyx":452
 *         if not isinstance(args, tuple):
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")
 *         if not callable(func):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("func from save_reduce() must be callable")
 * 
 */
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_func); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":453
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")
 *         if not callable(func):
 *             raise pickle.PicklingError("func from save_reduce() must be callable")             # <<<<<<<<<<<<<<
 * 
 *         save = self.save
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cycloudpickle/cypickle.pyx":452
 *         if not isinstance(args, tuple):
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")
 *         if not callable(func):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("func from save_reduce() must be callable")
 * 
 */
  }

  /* "cycloudpickle/cypickle.pyx":455
 *             raise pickle.PicklingError("func from save_reduce() must be callable")
 * 
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_save = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":456
 * 
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         cdef str func_name = getattr(func, "__name__", "")
 */
  __pyx_t_3 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_write = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":458
 *         write = self.write
 * 
 *         cdef str func_name = getattr(func, "__name__", "")             # <<<<<<<<<<<<<<
 *         if self.proto >= 4 and func_name == "__newobj_ex__":
 *             cls, args, kwargs = args
 */
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_u_name, __pyx_kp_u__4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_func_name = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":459
 * 
 *         cdef str func_name = getattr(func, "__name__", "")
 *         if self.proto >= 4 and func_name == "__newobj_ex__":             # <<<<<<<<<<<<<<
 *             cls, args, kwargs = args
 *             if not hasattr(cls, "__new__"):
 */
  __pyx_t_2 = ((__pyx_v_self->proto >= 4) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_newobj_ex, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":460
 *         cdef str func_name = getattr(func, "__name__", "")
 *         if self.proto >= 4 and func_name == "__newobj_ex__":
 *             cls, args, kwargs = args             # <<<<<<<<<<<<<<
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_args))) || (PyList_CheckExact(__pyx_v_args))) {
      PyObject* sequence = __pyx_v_args;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L9_unpacking_done:;
    }
    __pyx_v_cls = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_kwargs = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":461
 *         if self.proto >= 4 and func_name == "__newobj_ex__":
 *             cls, args, kwargs = args
 *             if not hasattr(cls, "__new__"):             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"
 *                                     .format(func_name))
 */
    __pyx_t_1 = PyObject_HasAttr(__pyx_v_cls, __pyx_n_u_new); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_5) {

      /* "cycloudpickle/cypickle.pyx":462
 *             cls, args, kwargs = args
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"             # <<<<<<<<<<<<<<
 *                                     .format(func_name))
 *             if obj is not None and cls is not obj.__class__:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cycloudpickle/cypickle.pyx":463
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"
 *                                     .format(func_name))             # <<<<<<<<<<<<<<
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError("args[0] from {} args has the wrong class"
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_args_0_from_args_has_no___new, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_func_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_func_name);
        __Pyx_GIVEREF(__pyx_v_func_name);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_func_name);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cycloudpickle/cypickle.pyx":461
 *         if self.proto >= 4 and func_name == "__newobj_ex__":
 *             cls, args, kwargs = args
 *             if not hasattr(cls, "__new__"):             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"
 *                                     .format(func_name))
 */
    }

    /* "cycloudpickle/cypickle.pyx":464
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"
 *                                     .format(func_name))
 *             if obj is not None and cls is not obj.__class__:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError("args[0] from {} args has the wrong class"
 *                                     .format(func_name))
 */
    __pyx_t_1 = (__pyx_v_obj != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_5 = __pyx_t_2;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_class); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = (__pyx_v_cls != __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    __pyx_t_5 = __pyx_t_1;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_5) {

      /* "cycloudpickle/cypickle.pyx":465
 *                                     .format(func_name))
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError("args[0] from {} args has the wrong class"             # <<<<<<<<<<<<<<
 *                                     .format(func_name))
 *             save(cls)
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":466
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError("args[0] from {} args has the wrong class"
 *                                     .format(func_name))             # <<<<<<<<<<<<<<
 *             save(cls)
 *             save(args)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_args_0_from_args_has_the_wrong_c, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_func_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_func_name);
        __Pyx_GIVEREF(__pyx_v_func_name);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_func_name);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cycloudpickle/cypickle.pyx":464
 *                 raise pickle.PicklingError("args[0] from {} args has no __new__"
 *                                     .format(func_name))
 *             if obj is not None and cls is not obj.__class__:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError("args[0] from {} args has the wrong class"
 *                                     .format(func_name))
 */
    }

    /* "cycloudpickle/cypickle.pyx":467
 *                 raise pickle.PicklingError("args[0] from {} args has the wrong class"
 *                                     .format(func_name))
 *             save(cls)             # <<<<<<<<<<<<<<
 *             save(args)
 *             save(kwargs)
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_cls); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_cls);
      __Pyx_GIVEREF(__pyx_v_cls);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_cls);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":468
 *                                     .format(func_name))
 *             save(cls)
 *             save(args)             # <<<<<<<<<<<<<<
 *             save(kwargs)
 *             write(NEWOBJ_EX)
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_args);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":469
 *             save(cls)
 *             save(args)
 *             save(kwargs)             # <<<<<<<<<<<<<<
 *             write(NEWOBJ_EX)
 *         elif self.proto >= 2 and func_name == "__newobj__":
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_kwargs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_kwargs);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":470
 *             save(args)
 *             save(kwargs)
 *             write(NEWOBJ_EX)             # <<<<<<<<<<<<<<
 *         elif self.proto >= 2 and func_name == "__newobj__":
 *             # A __reduce__ implementation can direct protocol 2 or newer to
 */
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_10 = __pyx_v_write; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":459
 * 
 *         cdef str func_name = getattr(func, "__name__", "")
 *         if self.proto >= 4 and func_name == "__newobj_ex__":             # <<<<<<<<<<<<<<
 *             cls, args, kwargs = args
 *             if not hasattr(cls, "__new__"):
 */
    goto __pyx_L5;
  }

  /* "cycloudpickle/cypickle.pyx":471
 *             save(kwargs)
 *             write(NEWOBJ_EX)
 *         elif self.proto >= 2 and func_name == "__newobj__":             # <<<<<<<<<<<<<<
 *             # A __reduce__ implementation can direct protocol 2 or newer to
 *             # use the more efficient NEWOBJ opcode, while still
 */
  __pyx_t_1 = ((__pyx_v_self->proto >= 2) != 0);
  if (__pyx_t_1) {
  } else {
    __pyx_t_5 = __pyx_t_1;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_newobj, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  __pyx_t_5 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":498
 *             # protocol 0 or 1 in Python 2.3 should be unpicklable by
 *             # Python 2.2).
 *             cls = args[0]             # <<<<<<<<<<<<<<
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError(
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_cls = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":499
 *             # Python 2.2).
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 */
    __pyx_t_5 = PyObject_HasAttr(__pyx_v_cls, __pyx_n_u_new); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((!(__pyx_t_5 != 0)) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":500
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cycloudpickle/cypickle.pyx":499
 *             # Python 2.2).
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 */
    }

    /* "cycloudpickle/cypickle.pyx":502
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 */
    __pyx_t_5 = (__pyx_v_obj != Py_None);
    __pyx_t_1 = (__pyx_t_5 != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_class); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = (__pyx_v_cls != __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__pyx_t_1 != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":503
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cycloudpickle/cypickle.pyx":502
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 */
    }

    /* "cycloudpickle/cypickle.pyx":505
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]             # <<<<<<<<<<<<<<
 *             save(cls)
 *             save(args)
 */
    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_args, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":506
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]
 *             save(cls)             # <<<<<<<<<<<<<<
 *             save(args)
 *             write(NEWOBJ)
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_cls); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_cls);
      __Pyx_GIVEREF(__pyx_v_cls);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_cls);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":507
 *             args = args[1:]
 *             save(cls)
 *             save(args)             # <<<<<<<<<<<<<<
 *             write(NEWOBJ)
 *         else:
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_args);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":508
 *             save(cls)
 *             save(args)
 *             write(NEWOBJ)             # <<<<<<<<<<<<<<
 *         else:
 *             save(func)
 */
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_10 = __pyx_v_write; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_13cycloudpickle_8cypickle_NEWOBJ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_13cycloudpickle_8cypickle_NEWOBJ);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":471
 *             save(kwargs)
 *             write(NEWOBJ_EX)
 *         elif self.proto >= 2 and func_name == "__newobj__":             # <<<<<<<<<<<<<<
 *             # A __reduce__ implementation can direct protocol 2 or newer to
 *             # use the more efficient NEWOBJ opcode, while still
 */
    goto __pyx_L5;
  }

  /* "cycloudpickle/cypickle.pyx":510
 *             write(NEWOBJ)
 *         else:
 *             save(func)             # <<<<<<<<<<<<<<
 *             save(args)
 *             write(REDUCE)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_func); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_func);
      __Pyx_GIVEREF(__pyx_v_func);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_func);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":511
 *         else:
 *             save(func)
 *             save(args)             # <<<<<<<<<<<<<<
 *             write(REDUCE)
 * 
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_10 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_args);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":512
 *             save(func)
 *             save(args)
 *             write(REDUCE)             # <<<<<<<<<<<<<<
 * 
 *         if obj is not None:
 */
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_10 = __pyx_v_write; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_13cycloudpickle_8cypickle_REDUCE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_REDUCE);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_REDUCE);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_13cycloudpickle_8cypickle_REDUCE);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L5:;

  /* "cycloudpickle/cypickle.pyx":514
 *             write(REDUCE)
 * 
 *         if obj is not None:             # <<<<<<<<<<<<<<
 *             # If the object is already in the memo, this means it is
 *             # recursive. In this case, throw away everything we put on the
 */
  __pyx_t_2 = (__pyx_v_obj != Py_None);
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":518
 *             # recursive. In this case, throw away everything we put on the
 *             # stack, and fetch the object back from the memo.
 *             if id(obj) in self.memo:             # <<<<<<<<<<<<<<
 *                 write(POP + self.get(self.memo[id(obj)][0]))
 *             else:
 */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_obj);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v_self->memo == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_t_10, __pyx_v_self->memo, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":519
 *             # stack, and fetch the object back from the memo.
 *             if id(obj) in self.memo:
 *                 write(POP + self.get(self.memo[id(obj)][0]))             # <<<<<<<<<<<<<<
 *             else:
 *                 self.memoize(obj)
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(__pyx_v_self->memo == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->memo, __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_POP, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_6 = __pyx_v_write; __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_10);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cycloudpickle/cypickle.pyx":518
 *             # recursive. In this case, throw away everything we put on the
 *             # stack, and fetch the object back from the memo.
 *             if id(obj) in self.memo:             # <<<<<<<<<<<<<<
 *                 write(POP + self.get(self.memo[id(obj)][0]))
 *             else:
 */
      goto __pyx_L21;
    }

    /* "cycloudpickle/cypickle.pyx":521
 *                 write(POP + self.get(self.memo[id(obj)][0]))
 *             else:
 *                 self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *         # More new special cases (that work with older protocols as
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_obj);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_L21:;

    /* "cycloudpickle/cypickle.pyx":514
 *             write(REDUCE)
 * 
 *         if obj is not None:             # <<<<<<<<<<<<<<
 *             # If the object is already in the memo, this means it is
 *             # recursive. In this case, throw away everything we put on the
 */
  }

  /* "cycloudpickle/cypickle.pyx":528
 *         # items and dict items (as (key, value) tuples), or None.
 * 
 *         if listitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_appends(listitems)
 * 
 */
  __pyx_t_2 = (__pyx_v_listitems != Py_None);
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":529
 * 
 *         if listitems is not None:
 *             self._batch_appends(listitems)             # <<<<<<<<<<<<<<
 * 
 *         if dictitems is not None:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_batch_appends); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_listitems); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_listitems);
      __Pyx_GIVEREF(__pyx_v_listitems);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_listitems);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":528
 *         # items and dict items (as (key, value) tuples), or None.
 * 
 *         if listitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_appends(listitems)
 * 
 */
  }

  /* "cycloudpickle/cypickle.pyx":531
 *             self._batch_appends(listitems)
 * 
 *         if dictitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_setitems(dictitems)
 * 
 */
  __pyx_t_5 = (__pyx_v_dictitems != Py_None);
  __pyx_t_2 = (__pyx_t_5 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":532
 * 
 *         if dictitems is not None:
 *             self._batch_setitems(dictitems)             # <<<<<<<<<<<<<<
 * 
 *         if state is not None:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_batch_setitems); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dictitems); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_dictitems);
      __Pyx_GIVEREF(__pyx_v_dictitems);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_dictitems);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":531
 *             self._batch_appends(listitems)
 * 
 *         if dictitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_setitems(dictitems)
 * 
 */
  }

  /* "cycloudpickle/cypickle.pyx":534
 *             self._batch_setitems(dictitems)
 * 
 *         if state is not None:             # <<<<<<<<<<<<<<
 *             save(state)
 *             write(BUILD)
 */
  __pyx_t_2 = (__pyx_v_state != Py_None);
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "cycloudpickle/cypickle.pyx":535
 * 
 *         if state is not None:
 *             save(state)             # <<<<<<<<<<<<<<
 *             write(BUILD)
 * 
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_6 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_state); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_state);
      __Pyx_GIVEREF(__pyx_v_state);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_state);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":536
 *         if state is not None:
 *             save(state)
 *             write(BUILD)             # <<<<<<<<<<<<<<
 * 
 *     # Methods below this point are dispatched through the dispatch table
 */
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_6 = __pyx_v_write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_13cycloudpickle_8cypickle_BUILD); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_BUILD);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_BUILD);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_13cycloudpickle_8cypickle_BUILD);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":534
 *             self._batch_setitems(dictitems)
 * 
 *         if state is not None:             # <<<<<<<<<<<<<<
 *             save(state)
 *             write(BUILD)
 */
  }

  /* "cycloudpickle/cypickle.pyx":446
 *             self.write(PERSID + str(pid).encode("ascii") + b'\n')
 * 
 *     def save_reduce(self, func, args, state=None, listitems=None,             # <<<<<<<<<<<<<<
 *                     dictitems=None, obj=None):
 *         # This API is called by some subclasses
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_func_name);
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":542
 *     dispatch = {}
 * 
 *     def save_none(self, obj):             # <<<<<<<<<<<<<<
 *         self.write(NONE)
 *     dispatch[type(None)] = save_none
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_21save_none(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_21save_none(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_none (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_20save_none(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_20save_none(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_none", 0);

  /* "cycloudpickle/cypickle.pyx":543
 * 
 *     def save_none(self, obj):
 *         self.write(NONE)             # <<<<<<<<<<<<<<
 *     dispatch[type(None)] = save_none
 * 
 */
  __Pyx_INCREF(__pyx_v_self->write);
  __pyx_t_2 = __pyx_v_self->write; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_13cycloudpickle_8cypickle_NONE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_NONE);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_NONE);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_13cycloudpickle_8cypickle_NONE);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":542
 *     dispatch = {}
 * 
 *     def save_none(self, obj):             # <<<<<<<<<<<<<<
 *         self.write(NONE)
 *     dispatch[type(None)] = save_none
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":546
 *     dispatch[type(None)] = save_none
 * 
 *     def save_bool(self, obj):             # <<<<<<<<<<<<<<
 *         if self.proto >= 2:
 *             self.write(NEWTRUE if obj else NEWFALSE)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_23save_bool(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_23save_bool(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_bool (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_22save_bool(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_22save_bool(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_bool", 0);

  /* "cycloudpickle/cypickle.pyx":547
 * 
 *     def save_bool(self, obj):
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             self.write(NEWTRUE if obj else NEWFALSE)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->proto >= 2) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":548
 *     def save_bool(self, obj):
 *         if self.proto >= 2:
 *             self.write(NEWTRUE if obj else NEWFALSE)             # <<<<<<<<<<<<<<
 *         else:
 *             self.write(TRUE if obj else FALSE)
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_NEWTRUE);
      __pyx_t_3 = __pyx_v_13cycloudpickle_8cypickle_NEWTRUE;
    } else {
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_NEWFALSE);
      __pyx_t_3 = __pyx_v_13cycloudpickle_8cypickle_NEWFALSE;
    }
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_4 = __pyx_v_self->write; __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":547
 * 
 *     def save_bool(self, obj):
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             self.write(NEWTRUE if obj else NEWFALSE)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cypickle.pyx":550
 *             self.write(NEWTRUE if obj else NEWFALSE)
 *         else:
 *             self.write(TRUE if obj else FALSE)             # <<<<<<<<<<<<<<
 *     dispatch[bool] = save_bool
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_TRUE);
      __pyx_t_4 = __pyx_v_13cycloudpickle_8cypickle_TRUE;
    } else {
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_FALSE);
      __pyx_t_4 = __pyx_v_13cycloudpickle_8cypickle_FALSE;
    }
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_6 = __pyx_v_self->write; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cypickle.pyx":546
 *     dispatch[type(None)] = save_none
 * 
 *     def save_bool(self, obj):             # <<<<<<<<<<<<<<
 *         if self.proto >= 2:
 *             self.write(NEWTRUE if obj else NEWFALSE)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":553
 *     dispatch[bool] = save_bool
 * 
 *     def save_long(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             # If the int is small enough to fit in a signed 4-byte 2's-comp
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_25save_long(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_25save_long(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_long (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_24save_long(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_24save_long(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_encoded = NULL;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_long", 0);

  /* "cycloudpickle/cypickle.pyx":554
 * 
 *     def save_long(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             # If the int is small enough to fit in a signed 4-byte 2's-comp
 *             # format, we can store it more efficiently than the general
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":559
 *             # case.
 *             # First one- and two-byte unsigned ints:
 *             if obj >= 0:             # <<<<<<<<<<<<<<
 *                 if obj <= 0xff:
 *                     self.write(BININT1 + pack("<B", obj))
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_obj, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":560
 *             # First one- and two-byte unsigned ints:
 *             if obj >= 0:
 *                 if obj <= 0xff:             # <<<<<<<<<<<<<<
 *                     self.write(BININT1 + pack("<B", obj))
 *                     return
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_obj, __pyx_int_255, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cycloudpickle/cypickle.pyx":561
 *             if obj >= 0:
 *                 if obj <= 0xff:
 *                     self.write(BININT1 + pack("<B", obj))             # <<<<<<<<<<<<<<
 *                     return
 *                 if obj <= 0xffff:
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_B);
        __Pyx_GIVEREF(__pyx_kp_u_B);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_B);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_obj);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BININT1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_INCREF(__pyx_v_self->write);
        __pyx_t_3 = __pyx_v_self->write; __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cycloudpickle/cypickle.pyx":562
 *                 if obj <= 0xff:
 *                     self.write(BININT1 + pack("<B", obj))
 *                     return             # <<<<<<<<<<<<<<
 *                 if obj <= 0xffff:
 *                     self.write(BININT2 + pack("<H", obj))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

        /* "cycloudpickle/cypickle.pyx":560
 *             # First one- and two-byte unsigned ints:
 *             if obj >= 0:
 *                 if obj <= 0xff:             # <<<<<<<<<<<<<<
 *                     self.write(BININT1 + pack("<B", obj))
 *                     return
 */
      }

      /* "cycloudpickle/cypickle.pyx":563
 *                     self.write(BININT1 + pack("<B", obj))
 *                     return
 *                 if obj <= 0xffff:             # <<<<<<<<<<<<<<
 *                     self.write(BININT2 + pack("<H", obj))
 *                     return
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_obj, __pyx_int_65535, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cycloudpickle/cypickle.pyx":564
 *                     return
 *                 if obj <= 0xffff:
 *                     self.write(BININT2 + pack("<H", obj))             # <<<<<<<<<<<<<<
 *                     return
 *             # Next check for 4-byte signed ints:
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_6 = 1;
          }
        }
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_H);
        __Pyx_GIVEREF(__pyx_kp_u_H);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_H);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_obj);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BININT2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_INCREF(__pyx_v_self->write);
        __pyx_t_3 = __pyx_v_self->write; __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cycloudpickle/cypickle.pyx":565
 *                 if obj <= 0xffff:
 *                     self.write(BININT2 + pack("<H", obj))
 *                     return             # <<<<<<<<<<<<<<
 *             # Next check for 4-byte signed ints:
 *             if -0x80000000 <= obj <= 0x7fffffff:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

        /* "cycloudpickle/cypickle.pyx":563
 *                     self.write(BININT1 + pack("<B", obj))
 *                     return
 *                 if obj <= 0xffff:             # <<<<<<<<<<<<<<
 *                     self.write(BININT2 + pack("<H", obj))
 *                     return
 */
      }

      /* "cycloudpickle/cypickle.pyx":559
 *             # case.
 *             # First one- and two-byte unsigned ints:
 *             if obj >= 0:             # <<<<<<<<<<<<<<
 *                 if obj <= 0xff:
 *                     self.write(BININT1 + pack("<B", obj))
 */
    }

    /* "cycloudpickle/cypickle.pyx":567
 *                     return
 *             # Next check for 4-byte signed ints:
 *             if -0x80000000 <= obj <= 0x7fffffff:             # <<<<<<<<<<<<<<
 *                 self.write(BININT + pack("<i", obj))
 *                 return
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_int_neg_2147483648, __pyx_v_obj, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_obj, __pyx_int_2147483647, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":568
 *             # Next check for 4-byte signed ints:
 *             if -0x80000000 <= obj <= 0x7fffffff:
 *                 self.write(BININT + pack("<i", obj))             # <<<<<<<<<<<<<<
 *                 return
 *         if self.proto >= 2:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_i);
      __Pyx_GIVEREF(__pyx_kp_u_i);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_i);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_obj);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BININT, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_3 = __pyx_v_self->write; __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cycloudpickle/cypickle.pyx":569
 *             if -0x80000000 <= obj <= 0x7fffffff:
 *                 self.write(BININT + pack("<i", obj))
 *                 return             # <<<<<<<<<<<<<<
 *         if self.proto >= 2:
 *             encoded = encode_long(obj)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":567
 *                     return
 *             # Next check for 4-byte signed ints:
 *             if -0x80000000 <= obj <= 0x7fffffff:             # <<<<<<<<<<<<<<
 *                 self.write(BININT + pack("<i", obj))
 *                 return
 */
    }

    /* "cycloudpickle/cypickle.pyx":554
 * 
 *     def save_long(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             # If the int is small enough to fit in a signed 4-byte 2's-comp
 *             # format, we can store it more efficiently than the general
 */
  }

  /* "cycloudpickle/cypickle.pyx":570
 *                 self.write(BININT + pack("<i", obj))
 *                 return
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             encoded = encode_long(obj)
 *             n = len(encoded)
 */
  __pyx_t_1 = ((__pyx_v_self->proto >= 2) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":571
 *                 return
 *         if self.proto >= 2:
 *             encoded = encode_long(obj)             # <<<<<<<<<<<<<<
 *             n = len(encoded)
 *             if n < 256:
 */
    __pyx_t_2 = __pyx_f_13cycloudpickle_8cypickle_encode_long(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_encoded = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":572
 *         if self.proto >= 2:
 *             encoded = encode_long(obj)
 *             n = len(encoded)             # <<<<<<<<<<<<<<
 *             if n < 256:
 *                 self.write(LONG1 + pack("<B", n) + encoded)
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_encoded); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n = __pyx_t_6;

    /* "cycloudpickle/cypickle.pyx":573
 *             encoded = encode_long(obj)
 *             n = len(encoded)
 *             if n < 256:             # <<<<<<<<<<<<<<
 *                 self.write(LONG1 + pack("<B", n) + encoded)
 *             else:
 */
    __pyx_t_1 = ((__pyx_v_n < 0x100) != 0);
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":574
 *             n = len(encoded)
 *             if n < 256:
 *                 self.write(LONG1 + pack("<B", n) + encoded)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.write(LONG4 + pack("<i", n) + encoded)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_kp_u_B);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_LONG1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_encoded); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_5 = __pyx_v_self->write; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cycloudpickle/cypickle.pyx":573
 *             encoded = encode_long(obj)
 *             n = len(encoded)
 *             if n < 256:             # <<<<<<<<<<<<<<
 *                 self.write(LONG1 + pack("<B", n) + encoded)
 *             else:
 */
      goto __pyx_L9;
    }

    /* "cycloudpickle/cypickle.pyx":576
 *                 self.write(LONG1 + pack("<B", n) + encoded)
 *             else:
 *                 self.write(LONG4 + pack("<i", n) + encoded)             # <<<<<<<<<<<<<<
 *             return
 *         self.write(LONG + repr(obj).encode("ascii") + b'L\n')
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_i);
      __Pyx_GIVEREF(__pyx_kp_u_i);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_i);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_LONG4, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_encoded); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_4 = __pyx_v_self->write; __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L9:;

    /* "cycloudpickle/cypickle.pyx":577
 *             else:
 *                 self.write(LONG4 + pack("<i", n) + encoded)
 *             return             # <<<<<<<<<<<<<<
 *         self.write(LONG + repr(obj).encode("ascii") + b'L\n')
 *     dispatch[int] = save_long
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":570
 *                 self.write(BININT + pack("<i", obj))
 *                 return
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             encoded = encode_long(obj)
 *             n = len(encoded)
 */
  }

  /* "cycloudpickle/cypickle.pyx":578
 *                 self.write(LONG4 + pack("<i", n) + encoded)
 *             return
 *         self.write(LONG + repr(obj).encode("ascii") + b'L\n')             # <<<<<<<<<<<<<<
 *     dispatch[int] = save_long
 * 
 */
  __pyx_t_4 = PyObject_Repr(__pyx_v_obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_LONG, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_n_b_L); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_v_self->write);
  __pyx_t_3 = __pyx_v_self->write; __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":553
 *     dispatch[bool] = save_bool
 * 
 *     def save_long(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             # If the int is small enough to fit in a signed 4-byte 2's-comp
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_encoded);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":581
 *     dispatch[int] = save_long
 * 
 *     def save_float(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             self.write(BINFLOAT + pack('>d', obj))
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_27save_float(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_27save_float(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_float (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_26save_float(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_26save_float(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_float", 0);

  /* "cycloudpickle/cypickle.pyx":582
 * 
 *     def save_float(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.write(BINFLOAT + pack('>d', obj))
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":583
 *     def save_float(self, obj):
 *         if self.bin:
 *             self.write(BINFLOAT + pack('>d', obj))             # <<<<<<<<<<<<<<
 *         else:
 *             self.write(FLOAT + repr(obj).encode("ascii") + b'\n')
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_d);
    __Pyx_GIVEREF(__pyx_kp_u_d);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_d);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_obj);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINFLOAT, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_3 = __pyx_v_self->write; __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":582
 * 
 *     def save_float(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.write(BINFLOAT + pack('>d', obj))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cypickle.pyx":585
 *             self.write(BINFLOAT + pack('>d', obj))
 *         else:
 *             self.write(FLOAT + repr(obj).encode("ascii") + b'\n')             # <<<<<<<<<<<<<<
 *     dispatch[float] = save_float
 * 
 */
  /*else*/ {
    __pyx_t_3 = PyObject_Repr(__pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_FLOAT, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_5 = __pyx_v_self->write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cypickle.pyx":581
 *     dispatch[int] = save_long
 * 
 *     def save_float(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             self.write(BINFLOAT + pack('>d', obj))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":588
 *     dispatch[float] = save_float
 * 
 *     def save_bytes(self, obj):             # <<<<<<<<<<<<<<
 *         if self.proto < 3:
 *             if not obj:  # bytes object is empty
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_29save_bytes(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_29save_bytes(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_28save_bytes(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_28save_bytes(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_bytes", 0);

  /* "cycloudpickle/cypickle.pyx":589
 * 
 *     def save_bytes(self, obj):
 *         if self.proto < 3:             # <<<<<<<<<<<<<<
 *             if not obj:  # bytes object is empty
 *                 self.save_reduce(bytes, (), obj=obj)
 */
  __pyx_t_1 = ((__pyx_v_self->proto < 3) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":590
 *     def save_bytes(self, obj):
 *         if self.proto < 3:
 *             if not obj:  # bytes object is empty             # <<<<<<<<<<<<<<
 *                 self.save_reduce(bytes, (), obj=obj)
 *             else:
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((!__pyx_t_1) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":591
 *         if self.proto < 3:
 *             if not obj:  # bytes object is empty
 *                 self.save_reduce(bytes, (), obj=obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.save_reduce(codecs.encode,
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
      __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyBytes_Type)));
      __Pyx_INCREF(__pyx_empty_tuple);
      __Pyx_GIVEREF(__pyx_empty_tuple);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_empty_tuple);
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":590
 *     def save_bytes(self, obj):
 *         if self.proto < 3:
 *             if not obj:  # bytes object is empty             # <<<<<<<<<<<<<<
 *                 self.save_reduce(bytes, (), obj=obj)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "cycloudpickle/cypickle.pyx":593
 *                 self.save_reduce(bytes, (), obj=obj)
 *             else:
 *                 self.save_reduce(codecs.encode,             # <<<<<<<<<<<<<<
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)
 *             return
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":594
 *             else:
 *                 self.save_reduce(codecs.encode,
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)             # <<<<<<<<<<<<<<
 *             return
 *         n = len(obj)
 */
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_obj);
      __Pyx_INCREF(__pyx_n_u_latin1);
      __Pyx_GIVEREF(__pyx_n_u_latin1);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_latin1);
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __Pyx_INCREF(__pyx_n_u_latin1);
      __Pyx_GIVEREF(__pyx_n_u_latin1);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_latin1);
      __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":593
 *                 self.save_reduce(bytes, (), obj=obj)
 *             else:
 *                 self.save_reduce(codecs.encode,             # <<<<<<<<<<<<<<
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)
 *             return
 */
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":594
 *             else:
 *                 self.save_reduce(codecs.encode,
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)             # <<<<<<<<<<<<<<
 *             return
 *         n = len(obj)
 */
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cycloudpickle/cypickle.pyx":593
 *                 self.save_reduce(bytes, (), obj=obj)
 *             else:
 *                 self.save_reduce(codecs.encode,             # <<<<<<<<<<<<<<
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)
 *             return
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L4:;

    /* "cycloudpickle/cypickle.pyx":595
 *                 self.save_reduce(codecs.encode,
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)
 *             return             # <<<<<<<<<<<<<<
 *         n = len(obj)
 *         if n <= 0xff:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":589
 * 
 *     def save_bytes(self, obj):
 *         if self.proto < 3:             # <<<<<<<<<<<<<<
 *             if not obj:  # bytes object is empty
 *                 self.save_reduce(bytes, (), obj=obj)
 */
  }

  /* "cycloudpickle/cypickle.pyx":596
 *                                  (str(obj, 'latin1'), 'latin1'), obj=obj)
 *             return
 *         n = len(obj)             # <<<<<<<<<<<<<<
 *         if n <= 0xff:
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "cycloudpickle/cypickle.pyx":597
 *             return
 *         n = len(obj)
 *         if n <= 0xff:             # <<<<<<<<<<<<<<
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)
 *         elif n > 0xffffffff and self.proto >= 4:
 */
  __pyx_t_2 = ((__pyx_v_n <= 0xff) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":598
 *         n = len(obj)
 *         if n <= 0xff:
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)             # <<<<<<<<<<<<<<
 *         elif n > 0xffffffff and self.proto >= 4:
 *             self.write(BINBYTES8 + pack("<Q", n) + obj)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_B);
    __Pyx_GIVEREF(__pyx_kp_u_B);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_kp_u_B);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINBYTES, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_obj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_3 = __pyx_v_self->write; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cycloudpickle/cypickle.pyx":597
 *             return
 *         n = len(obj)
 *         if n <= 0xff:             # <<<<<<<<<<<<<<
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)
 *         elif n > 0xffffffff and self.proto >= 4:
 */
    goto __pyx_L5;
  }

  /* "cycloudpickle/cypickle.pyx":599
 *         if n <= 0xff:
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)
 *         elif n > 0xffffffff and self.proto >= 4:             # <<<<<<<<<<<<<<
 *             self.write(BINBYTES8 + pack("<Q", n) + obj)
 *         else:
 */
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_4294967295, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_self->proto >= 4) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":600
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)
 *         elif n > 0xffffffff and self.proto >= 4:
 *             self.write(BINBYTES8 + pack("<Q", n) + obj)             # <<<<<<<<<<<<<<
 *         else:
 *             self.write(BINBYTES + pack("<I", n) + obj)
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Q);
    __Pyx_GIVEREF(__pyx_kp_u_Q);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_Q);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINBYTES8, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_v_obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_6 = __pyx_v_self->write; __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":599
 *         if n <= 0xff:
 *             self.write(SHORT_BINBYTES + pack("<B", n) + obj)
 *         elif n > 0xffffffff and self.proto >= 4:             # <<<<<<<<<<<<<<
 *             self.write(BINBYTES8 + pack("<Q", n) + obj)
 *         else:
 */
    goto __pyx_L5;
  }

  /* "cycloudpickle/cypickle.pyx":602
 *             self.write(BINBYTES8 + pack("<Q", n) + obj)
 *         else:
 *             self.write(BINBYTES + pack("<I", n) + obj)             # <<<<<<<<<<<<<<
 *         self.memoize(obj)
 *     dispatch[bytes] = save_bytes
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_I);
    __Pyx_GIVEREF(__pyx_kp_u_I);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_kp_u_I);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINBYTES, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_5 = __pyx_v_self->write; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "cycloudpickle/cypickle.pyx":603
 *         else:
 *             self.write(BINBYTES + pack("<I", n) + obj)
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 *     dispatch[bytes] = save_bytes
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_obj);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":588
 *     dispatch[float] = save_float
 * 
 *     def save_bytes(self, obj):             # <<<<<<<<<<<<<<
 *         if self.proto < 3:
 *             if not obj:  # bytes object is empty
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":606
 *     dispatch[bytes] = save_bytes
 * 
 *     def save_str(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_31save_str(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_31save_str(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_str (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_30save_str(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_30save_str(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_encoded = NULL;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_str", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "cycloudpickle/cypickle.pyx":607
 * 
 *     def save_str(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 *             n = len(encoded)
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":608
 *     def save_str(self, obj):
 *         if self.bin:
 *             encoded = obj.encode('utf-8', 'surrogatepass')             # <<<<<<<<<<<<<<
 *             n = len(encoded)
 *             if n <= 0xff and self.proto >= 4:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_encoded = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":609
 *         if self.bin:
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 *             n = len(encoded)             # <<<<<<<<<<<<<<
 *             if n <= 0xff and self.proto >= 4:
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_encoded); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n = __pyx_t_4;

    /* "cycloudpickle/cypickle.pyx":610
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 *             n = len(encoded)
 *             if n <= 0xff and self.proto >= 4:             # <<<<<<<<<<<<<<
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
 *             elif n > 0xffffffff and self.proto >= 4:
 */
    __pyx_t_5 = ((__pyx_v_n <= 0xff) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_1 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_self->proto >= 4) != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":611
 *             n = len(encoded)
 *             if n <= 0xff and self.proto >= 4:
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)             # <<<<<<<<<<<<<<
 *             elif n > 0xffffffff and self.proto >= 4:
 *                 self.write(BINUNICODE8 + pack("<Q", n) + encoded)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_4 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_kp_u_B);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_kp_u_B);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINUNICODE, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_v_encoded); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_6 = __pyx_v_self->write; __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":610
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 *             n = len(encoded)
 *             if n <= 0xff and self.proto >= 4:             # <<<<<<<<<<<<<<
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
 *             elif n > 0xffffffff and self.proto >= 4:
 */
      goto __pyx_L4;
    }

    /* "cycloudpickle/cypickle.pyx":612
 *             if n <= 0xff and self.proto >= 4:
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
 *             elif n > 0xffffffff and self.proto >= 4:             # <<<<<<<<<<<<<<
 *                 self.write(BINUNICODE8 + pack("<Q", n) + encoded)
 *             else:
 */
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_int_4294967295, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_1 = __pyx_t_5;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_self->proto >= 4) != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":613
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
 *             elif n > 0xffffffff and self.proto >= 4:
 *                 self.write(BINUNICODE8 + pack("<Q", n) + encoded)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.write(BINUNICODE + pack("<I", n) + encoded)
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_4 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_Q);
      __Pyx_GIVEREF(__pyx_kp_u_Q);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_kp_u_Q);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINUNICODE8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_encoded); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_7 = __pyx_v_self->write; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":612
 *             if n <= 0xff and self.proto >= 4:
 *                 self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
 *             elif n > 0xffffffff and self.proto >= 4:             # <<<<<<<<<<<<<<
 *                 self.write(BINUNICODE8 + pack("<Q", n) + encoded)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "cycloudpickle/cypickle.pyx":615
 *                 self.write(BINUNICODE8 + pack("<Q", n) + encoded)
 *             else:
 *                 self.write(BINUNICODE + pack("<I", n) + encoded)             # <<<<<<<<<<<<<<
 *         else:
 *             obj = obj.replace("\\", "\\u005c")
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_I);
      __Pyx_GIVEREF(__pyx_kp_u_I);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_kp_u_I);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_BINUNICODE, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_encoded); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_2 = __pyx_v_self->write; __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_L4:;

    /* "cycloudpickle/cypickle.pyx":607
 * 
 *     def save_str(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 *             n = len(encoded)
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cypickle.pyx":617
 *                 self.write(BINUNICODE + pack("<I", n) + encoded)
 *         else:
 *             obj = obj.replace("\\", "\\u005c")             # <<<<<<<<<<<<<<
 *             obj = obj.replace("\n", "\\u000a")
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":618
 *         else:
 *             obj = obj.replace("\\", "\\u005c")
 *             obj = obj.replace("\n", "\\u000a")             # <<<<<<<<<<<<<<
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +
 *                        b'\n')
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cycloudpickle/cypickle.pyx":619
 *             obj = obj.replace("\\", "\\u005c")
 *             obj = obj.replace("\n", "\\u000a")
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +             # <<<<<<<<<<<<<<
 *                        b'\n')
 *         self.memoize(obj)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_UNICODE, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b__7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_2 = __pyx_v_self->write; __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cypickle.pyx":621
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +
 *                        b'\n')
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 *     dispatch[str] = save_str
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cycloudpickle/cypickle.pyx":606
 *     dispatch[bytes] = save_bytes
 * 
 *     def save_str(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             encoded = obj.encode('utf-8', 'surrogatepass')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_encoded);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":624
 *     dispatch[str] = save_str
 * 
 *     def save_tuple(self, obj):             # <<<<<<<<<<<<<<
 *         if not obj:  # tuple is empty
 *             if self.bin:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_33save_tuple(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_33save_tuple(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_tuple (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_32save_tuple(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_32save_tuple(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_v_n;
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_memo = NULL;
  PyObject *__pyx_v_element = NULL;
  PyObject *__pyx_v_get = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_tuple", 0);

  /* "cycloudpickle/cypickle.pyx":625
 * 
 *     def save_tuple(self, obj):
 *         if not obj:  # tuple is empty             # <<<<<<<<<<<<<<
 *             if self.bin:
 *                 self.write(EMPTY_TUPLE)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":626
 *     def save_tuple(self, obj):
 *         if not obj:  # tuple is empty
 *             if self.bin:             # <<<<<<<<<<<<<<
 *                 self.write(EMPTY_TUPLE)
 *             else:
 */
    __pyx_t_2 = (__pyx_v_self->bin != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":627
 *         if not obj:  # tuple is empty
 *             if self.bin:
 *                 self.write(EMPTY_TUPLE)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.write(MARK + TUPLE)
 */
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_4 = __pyx_v_self->write; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cycloudpickle/cypickle.pyx":626
 *     def save_tuple(self, obj):
 *         if not obj:  # tuple is empty
 *             if self.bin:             # <<<<<<<<<<<<<<
 *                 self.write(EMPTY_TUPLE)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "cycloudpickle/cypickle.pyx":629
 *                 self.write(EMPTY_TUPLE)
 *             else:
 *                 self.write(MARK + TUPLE)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    /*else*/ {
      __pyx_t_4 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_MARK, __pyx_v_13cycloudpickle_8cypickle_TUPLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_6 = __pyx_v_self->write; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "cycloudpickle/cypickle.pyx":630
 *             else:
 *                 self.write(MARK + TUPLE)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cdef int n = len(obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":625
 * 
 *     def save_tuple(self, obj):
 *         if not obj:  # tuple is empty             # <<<<<<<<<<<<<<
 *             if self.bin:
 *                 self.write(EMPTY_TUPLE)
 */
  }

  /* "cycloudpickle/cypickle.pyx":632
 *             return
 * 
 *         cdef int n = len(obj)             # <<<<<<<<<<<<<<
 *         save = self.save
 *         memo = self.memo
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_8;

  /* "cycloudpickle/cypickle.pyx":633
 * 
 *         cdef int n = len(obj)
 *         save = self.save             # <<<<<<<<<<<<<<
 *         memo = self.memo
 *         if n <= 3 and self.proto >= 2:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_save = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":634
 *         cdef int n = len(obj)
 *         save = self.save
 *         memo = self.memo             # <<<<<<<<<<<<<<
 *         if n <= 3 and self.proto >= 2:
 *             for element in obj:
 */
  __pyx_t_3 = __pyx_v_self->memo;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_memo = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cycloudpickle/cypickle.pyx":635
 *         save = self.save
 *         memo = self.memo
 *         if n <= 3 and self.proto >= 2:             # <<<<<<<<<<<<<<
 *             for element in obj:
 *                 save(element)
 */
  __pyx_t_1 = ((__pyx_v_n <= 3) != 0);
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_self->proto >= 2) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":636
 *         memo = self.memo
 *         if n <= 3 and self.proto >= 2:
 *             for element in obj:             # <<<<<<<<<<<<<<
 *                 save(element)
 *             # Subtle.  Same as in the big comment below.
 */
    if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
      __pyx_t_3 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_element, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":637
 *         if n <= 3 and self.proto >= 2:
 *             for element in obj:
 *                 save(element)             # <<<<<<<<<<<<<<
 *             # Subtle.  Same as in the big comment below.
 *             if id(obj) in memo:
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_element); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_element);
        __Pyx_GIVEREF(__pyx_v_element);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_element);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":636
 *         memo = self.memo
 *         if n <= 3 and self.proto >= 2:
 *             for element in obj:             # <<<<<<<<<<<<<<
 *                 save(element)
 *             # Subtle.  Same as in the big comment below.
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cypickle.pyx":639
 *                 save(element)
 *             # Subtle.  Same as in the big comment below.
 *             if id(obj) in memo:             # <<<<<<<<<<<<<<
 *                 get = self.get(memo[id(obj)][0])
 *                 self.write(POP * n + get)
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_memo == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_6, __pyx_v_memo, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cycloudpickle/cypickle.pyx":640
 *             # Subtle.  Same as in the big comment below.
 *             if id(obj) in memo:
 *                 get = self.get(memo[id(obj)][0])             # <<<<<<<<<<<<<<
 *                 self.write(POP * n + get)
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__pyx_v_memo == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_memo, __pyx_t_5); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_get = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":641
 *             if id(obj) in memo:
 *                 get = self.get(memo[id(obj)][0])
 *                 self.write(POP * n + get)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.write(_tuplesize2code[n])
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyNumber_Multiply(__pyx_v_13cycloudpickle_8cypickle_POP, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_4 = __pyx_v_self->write; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":639
 *                 save(element)
 *             # Subtle.  Same as in the big comment below.
 *             if id(obj) in memo:             # <<<<<<<<<<<<<<
 *                 get = self.get(memo[id(obj)][0])
 *                 self.write(POP * n + get)
 */
      goto __pyx_L10;
    }

    /* "cycloudpickle/cypickle.pyx":643
 *                 self.write(POP * n + get)
 *             else:
 *                 self.write(_tuplesize2code[n])             # <<<<<<<<<<<<<<
 *                 self.memoize(obj)
 *             return
 */
    /*else*/ {
      if (unlikely(__pyx_v_13cycloudpickle_8cypickle__tuplesize2code == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_13cycloudpickle_8cypickle__tuplesize2code, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_self->write);
      __pyx_t_7 = __pyx_v_self->write; __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cycloudpickle/cypickle.pyx":644
 *             else:
 *                 self.write(_tuplesize2code[n])
 *                 self.memoize(obj)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_L10:;

    /* "cycloudpickle/cypickle.pyx":645
 *                 self.write(_tuplesize2code[n])
 *                 self.memoize(obj)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":635
 *         save = self.save
 *         memo = self.memo
 *         if n <= 3 and self.proto >= 2:             # <<<<<<<<<<<<<<
 *             for element in obj:
 *                 save(element)
 */
  }

  /* "cycloudpickle/cypickle.pyx":649
 *         # proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple
 *         # has more than 3 elements.
 *         write = self.write             # <<<<<<<<<<<<<<
 *         write(MARK)
 *         for element in obj:
 */
  __pyx_t_6 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_v_write = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cycloudpickle/cypickle.pyx":650
 *         # has more than 3 elements.
 *         write = self.write
 *         write(MARK)             # <<<<<<<<<<<<<<
 *         for element in obj:
 *             save(element)
 */
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_7 = __pyx_v_write; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_13cycloudpickle_8cypickle_MARK); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_13cycloudpickle_8cypickle_MARK);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cycloudpickle/cypickle.pyx":651
 *         write = self.write
 *         write(MARK)
 *         for element in obj:             # <<<<<<<<<<<<<<
 *             save(element)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
    __pyx_t_6 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_element, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cycloudpickle/cypickle.pyx":652
 *         write(MARK)
 *         for element in obj:
 *             save(element)             # <<<<<<<<<<<<<<
 * 
 *         if id(obj) in memo:
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_5 = __pyx_v_save; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_element); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_element);
      __Pyx_GIVEREF(__pyx_v_element);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_element);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cycloudpickle/cypickle.pyx":651
 *         write = self.write
 *         write(MARK)
 *         for element in obj:             # <<<<<<<<<<<<<<
 *             save(element)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cycloudpickle/cypickle.pyx":654
 *             save(element)
 * 
 *         if id(obj) in memo:             # <<<<<<<<<<<<<<
 *             # Subtle.  d was not in memo when we entered save_tuple(), so
 *             # the process of saving the tuple's elements must have saved
 */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_obj);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(__pyx_v_memo == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_7, __pyx_v_memo, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":662
 *             # could have been done in the "for element" loop instead, but
 *             # recursive tuples are a rare thing.
 *             get = self.get(memo[id(obj)][0])             # <<<<<<<<<<<<<<
 *             if self.bin:
 *                 write(POP_MARK + get)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__pyx_v_memo == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_obj);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_memo, __pyx_t_3); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_get = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cycloudpickle/cypickle.pyx":663
 *             # recursive tuples are a rare thing.
 *             get = self.get(memo[id(obj)][0])
 *             if self.bin:             # <<<<<<<<<<<<<<
 *                 write(POP_MARK + get)
 *             else:  # proto 0 -- POP_MARK not available
 */
    __pyx_t_2 = (__pyx_v_self->bin != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":664
 *             get = self.get(memo[id(obj)][0])
 *             if self.bin:
 *                 write(POP_MARK + get)             # <<<<<<<<<<<<<<
 *             else:  # proto 0 -- POP_MARK not available
 *                 write(POP * (n + 1) + get)
 */
      __pyx_t_6 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_POP_MARK, __pyx_v_get); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_4 = __pyx_v_write; __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cycloudpickle/cypickle.pyx":663
 *             # recursive tuples are a rare thing.
 *             get = self.get(memo[id(obj)][0])
 *             if self.bin:             # <<<<<<<<<<<<<<
 *                 write(POP_MARK + get)
 *             else:  # proto 0 -- POP_MARK not available
 */
      goto __pyx_L14;
    }

    /* "cycloudpickle/cypickle.pyx":666
 *                 write(POP_MARK + get)
 *             else:  # proto 0 -- POP_MARK not available
 *                 write(POP * (n + 1) + get)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_13cycloudpickle_8cypickle_POP, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_5 = __pyx_v_write; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_L14:;

    /* "cycloudpickle/cypickle.pyx":667
 *             else:  # proto 0 -- POP_MARK not available
 *                 write(POP * (n + 1) + get)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # No recursion.
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":654
 *             save(element)
 * 
 *         if id(obj) in memo:             # <<<<<<<<<<<<<<
 *             # Subtle.  d was not in memo when we entered save_tuple(), so
 *             # the process of saving the tuple's elements must have saved
 */
  }

  /* "cycloudpickle/cypickle.pyx":670
 * 
 *         # No recursion.
 *         write(TUPLE)             # <<<<<<<<<<<<<<
 *         self.memoize(obj)
 * 
 */
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_5 = __pyx_v_write; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_13cycloudpickle_8cypickle_TUPLE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_13cycloudpickle_8cypickle_TUPLE);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cycloudpickle/cypickle.pyx":671
 *         # No recursion.
 *         write(TUPLE)
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *     dispatch[tuple] = save_tuple
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cycloudpickle/cypickle.pyx":624
 *     dispatch[str] = save_str
 * 
 *     def save_tuple(self, obj):             # <<<<<<<<<<<<<<
 *         if not obj:  # tuple is empty
 *             if self.bin:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_memo);
  __Pyx_XDECREF(__pyx_v_element);
  __Pyx_XDECREF(__pyx_v_get);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":675
 *     dispatch[tuple] = save_tuple
 * 
 *     def save_list(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             self.write(EMPTY_LIST)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_35save_list(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_35save_list(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_list (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_34save_list(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_34save_list(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_list", 0);

  /* "cycloudpickle/cypickle.pyx":676
 * 
 *     def save_list(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.write(EMPTY_LIST)
 *         else:  # proto 0 -- can't use EMPTY_LIST
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":677
 *     def save_list(self, obj):
 *         if self.bin:
 *             self.write(EMPTY_LIST)             # <<<<<<<<<<<<<<
 *         else:  # proto 0 -- can't use EMPTY_LIST
 *             self.write(MARK + LIST)
 */
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_3 = __pyx_v_self->write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":676
 * 
 *     def save_list(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.write(EMPTY_LIST)
 *         else:  # proto 0 -- can't use EMPTY_LIST
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cypickle.pyx":679
 *             self.write(EMPTY_LIST)
 *         else:  # proto 0 -- can't use EMPTY_LIST
 *             self.write(MARK + LIST)             # <<<<<<<<<<<<<<
 * 
 *         self.memoize(obj)
 */
  /*else*/ {
    __pyx_t_3 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_MARK, __pyx_v_13cycloudpickle_8cypickle_LIST); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_5 = __pyx_v_self->write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cypickle.pyx":681
 *             self.write(MARK + LIST)
 * 
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 *         self._batch_appends(obj)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":682
 * 
 *         self.memoize(obj)
 *         self._batch_appends(obj)             # <<<<<<<<<<<<<<
 * 
 *     dispatch[list] = save_list
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_batch_appends); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_obj);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":675
 *     dispatch[tuple] = save_tuple
 * 
 *     def save_list(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             self.write(EMPTY_LIST)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":688
 *     _BATCHSIZE = 1000
 * 
 *     def _batch_appends(self, items):             # <<<<<<<<<<<<<<
 *         # Helper to batch up APPENDS sequences
 *         save = self.save
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_37_batch_appends(PyObject *__pyx_v_self, PyObject *__pyx_v_items); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_37_batch_appends(PyObject *__pyx_v_self, PyObject *__pyx_v_items) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_batch_appends (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_36_batch_appends(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_items));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_36_batch_appends(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_items) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_it = NULL;
  int __pyx_v_n;
  PyObject *__pyx_v_tmp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_batch_appends", 0);

  /* "cycloudpickle/cypickle.pyx":690
 *     def _batch_appends(self, items):
 *         # Helper to batch up APPENDS sequences
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_save = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":691
 *         # Helper to batch up APPENDS sequences
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         if not self.bin:
 */
  __pyx_t_1 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":693
 *         write = self.write
 * 
 *         if not self.bin:             # <<<<<<<<<<<<<<
 *             for x in items:
 *                 save(x)
 */
  __pyx_t_2 = ((!(__pyx_v_self->bin != 0)) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":694
 * 
 *         if not self.bin:
 *             for x in items:             # <<<<<<<<<<<<<<
 *                 save(x)
 *                 write(APPEND)
 */
    if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) {
      __pyx_t_1 = __pyx_v_items; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":695
 *         if not self.bin:
 *             for x in items:
 *                 save(x)             # <<<<<<<<<<<<<<
 *                 write(APPEND)
 *             return
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_6 = __pyx_v_save; __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_x);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":696
 *             for x in items:
 *                 save(x)
 *                 write(APPEND)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_6 = __pyx_v_write; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_13cycloudpickle_8cypickle_APPEND); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_APPEND);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_APPEND);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_13cycloudpickle_8cypickle_APPEND);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":694
 * 
 *         if not self.bin:
 *             for x in items:             # <<<<<<<<<<<<<<
 *                 save(x)
 *                 write(APPEND)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":697
 *                 save(x)
 *                 write(APPEND)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         it = iter(items)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":693
 *         write = self.write
 * 
 *         if not self.bin:             # <<<<<<<<<<<<<<
 *             for x in items:
 *                 save(x)
 */
  }

  /* "cycloudpickle/cypickle.pyx":699
 *             return
 * 
 *         it = iter(items)             # <<<<<<<<<<<<<<
 *         cdef int n
 *         cdef list tmp
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_it = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":702
 *         cdef int n
 *         cdef list tmp
 *         while True:             # <<<<<<<<<<<<<<
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)
 */
  while (1) {

    /* "cycloudpickle/cypickle.pyx":703
 *         cdef list tmp
 *         while True:
 *             tmp = list(islice(it, self._BATCHSIZE))             # <<<<<<<<<<<<<<
 *             n = len(tmp)
 *             if n > 1:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_islice); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BATCHSIZE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_3 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_3 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_it);
    __Pyx_GIVEREF(__pyx_v_it);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_3, __pyx_v_it);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_3, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_tmp, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":704
 *         while True:
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)             # <<<<<<<<<<<<<<
 *             if n > 1:
 *                 write(MARK)
 */
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_tmp); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n = __pyx_t_3;

    /* "cycloudpickle/cypickle.pyx":705
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)
 *             if n > 1:             # <<<<<<<<<<<<<<
 *                 write(MARK)
 *                 for x in tmp:
 */
    __pyx_t_2 = ((__pyx_v_n > 1) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":706
 *             n = len(tmp)
 *             if n > 1:
 *                 write(MARK)             # <<<<<<<<<<<<<<
 *                 for x in tmp:
 *                     save(x)
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_1 = __pyx_v_write; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_13cycloudpickle_8cypickle_MARK); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_13cycloudpickle_8cypickle_MARK);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":707
 *             if n > 1:
 *                 write(MARK)
 *                 for x in tmp:             # <<<<<<<<<<<<<<
 *                     save(x)
 *                 write(APPENDS)
 */
      __pyx_t_5 = __pyx_v_tmp; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
      for (;;) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cycloudpickle/cypickle.pyx":708
 *                 write(MARK)
 *                 for x in tmp:
 *                     save(x)             # <<<<<<<<<<<<<<
 *                 write(APPENDS)
 *             elif n:
 */
        __Pyx_INCREF(__pyx_v_save);
        __pyx_t_6 = __pyx_v_save; __pyx_t_8 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
          __Pyx_INCREF(__pyx_v_x);
          __Pyx_GIVEREF(__pyx_v_x);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_x);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cycloudpickle/cypickle.pyx":707
 *             if n > 1:
 *                 write(MARK)
 *                 for x in tmp:             # <<<<<<<<<<<<<<
 *                     save(x)
 *                 write(APPENDS)
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":709
 *                 for x in tmp:
 *                     save(x)
 *                 write(APPENDS)             # <<<<<<<<<<<<<<
 *             elif n:
 *                 save(tmp[0])
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_1 = __pyx_v_write; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_13cycloudpickle_8cypickle_APPENDS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_APPENDS);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_APPENDS);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_13cycloudpickle_8cypickle_APPENDS);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":705
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)
 *             if n > 1:             # <<<<<<<<<<<<<<
 *                 write(MARK)
 *                 for x in tmp:
 */
      goto __pyx_L8;
    }

    /* "cycloudpickle/cypickle.pyx":710
 *                     save(x)
 *                 write(APPENDS)
 *             elif n:             # <<<<<<<<<<<<<<
 *                 save(tmp[0])
 *                 write(APPEND)
 */
    __pyx_t_2 = (__pyx_v_n != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":711
 *                 write(APPENDS)
 *             elif n:
 *                 save(tmp[0])             # <<<<<<<<<<<<<<
 *                 write(APPEND)
 *             # else tmp is empty, and we're done
 */
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmp, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":712
 *             elif n:
 *                 save(tmp[0])
 *                 write(APPEND)             # <<<<<<<<<<<<<<
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_7 = __pyx_v_write; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_13cycloudpickle_8cypickle_APPEND); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_APPEND);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_APPEND);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_13cycloudpickle_8cypickle_APPEND);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":710
 *                     save(x)
 *                 write(APPENDS)
 *             elif n:             # <<<<<<<<<<<<<<
 *                 save(tmp[0])
 *                 write(APPEND)
 */
    }
    __pyx_L8:;

    /* "cycloudpickle/cypickle.pyx":714
 *                 write(APPEND)
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BATCHSIZE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":715
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:
 *                 return             # <<<<<<<<<<<<<<
 * 
 *     def save_dict(self, obj):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":714
 *                 write(APPEND)
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
    }
  }

  /* "cycloudpickle/cypickle.pyx":688
 *     _BATCHSIZE = 1000
 * 
 *     def _batch_appends(self, items):             # <<<<<<<<<<<<<<
 *         # Helper to batch up APPENDS sequences
 *         save = self.save
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler._batch_appends", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":717
 *                 return
 * 
 *     def save_dict(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             self.write(EMPTY_DICT)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_39save_dict(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_39save_dict(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_dict (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_38save_dict(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_38save_dict(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_dict", 0);

  /* "cycloudpickle/cypickle.pyx":718
 * 
 *     def save_dict(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.write(EMPTY_DICT)
 *         else:  # proto 0 -- can't use EMPTY_DICT
 */
  __pyx_t_1 = (__pyx_v_self->bin != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":719
 *     def save_dict(self, obj):
 *         if self.bin:
 *             self.write(EMPTY_DICT)             # <<<<<<<<<<<<<<
 *         else:  # proto 0 -- can't use EMPTY_DICT
 *             self.write(MARK + DICT)
 */
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_3 = __pyx_v_self->write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cypickle.pyx":718
 * 
 *     def save_dict(self, obj):
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             self.write(EMPTY_DICT)
 *         else:  # proto 0 -- can't use EMPTY_DICT
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cypickle.pyx":721
 *             self.write(EMPTY_DICT)
 *         else:  # proto 0 -- can't use EMPTY_DICT
 *             self.write(MARK + DICT)             # <<<<<<<<<<<<<<
 * 
 *         self.memoize(obj)
 */
  /*else*/ {
    __pyx_t_3 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_MARK, __pyx_v_13cycloudpickle_8cypickle_DICT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->write);
    __pyx_t_5 = __pyx_v_self->write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cypickle.pyx":723
 *             self.write(MARK + DICT)
 * 
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 *         self._batch_setitems(obj.items())
 *     dispatch[dict] = save_dict
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":724
 * 
 *         self.memoize(obj)
 *         self._batch_setitems(obj.items())             # <<<<<<<<<<<<<<
 *     dispatch[dict] = save_dict
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_batch_setitems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":717
 *                 return
 * 
 *     def save_dict(self, obj):             # <<<<<<<<<<<<<<
 *         if self.bin:
 *             self.write(EMPTY_DICT)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":727
 *     dispatch[dict] = save_dict
 * 
 *     def _batch_setitems(self, items):             # <<<<<<<<<<<<<<
 *         # Helper to batch up SETITEMS sequences; proto >= 1 only
 *         save = self.save
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_41_batch_setitems(PyObject *__pyx_v_self, PyObject *__pyx_v_items); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_41_batch_setitems(PyObject *__pyx_v_self, PyObject *__pyx_v_items) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_batch_setitems (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_40_batch_setitems(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_items));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_40_batch_setitems(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_items) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_it = NULL;
  PyObject *__pyx_v_tmp = NULL;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_batch_setitems", 0);

  /* "cycloudpickle/cypickle.pyx":729
 *     def _batch_setitems(self, items):
 *         # Helper to batch up SETITEMS sequences; proto >= 1 only
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_save = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":730
 *         # Helper to batch up SETITEMS sequences; proto >= 1 only
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         if not self.bin:
 */
  __pyx_t_1 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":732
 *         write = self.write
 * 
 *         if not self.bin:             # <<<<<<<<<<<<<<
 *             for k, v in items:
 *                 save(k)
 */
  __pyx_t_2 = ((!(__pyx_v_self->bin != 0)) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":733
 * 
 *         if not self.bin:
 *             for k, v in items:             # <<<<<<<<<<<<<<
 *                 save(k)
 *                 save(v)
 */
    if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) {
      __pyx_t_1 = __pyx_v_items; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cycloudpickle/cypickle.pyx":734
 *         if not self.bin:
 *             for k, v in items:
 *                 save(k)             # <<<<<<<<<<<<<<
 *                 save(v)
 *                 write(SETITEM)
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_k);
        __Pyx_GIVEREF(__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_k);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":735
 *             for k, v in items:
 *                 save(k)
 *                 save(v)             # <<<<<<<<<<<<<<
 *                 write(SETITEM)
 *             return
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_v); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_v);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":736
 *                 save(k)
 *                 save(v)
 *                 write(SETITEM)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_7 = __pyx_v_write; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_13cycloudpickle_8cypickle_SETITEM); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_SETITEM);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_SETITEM);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_13cycloudpickle_8cypickle_SETITEM);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":733
 * 
 *         if not self.bin:
 *             for k, v in items:             # <<<<<<<<<<<<<<
 *                 save(k)
 *                 save(v)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":737
 *                 save(v)
 *                 write(SETITEM)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         it = iter(items)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":732
 *         write = self.write
 * 
 *         if not self.bin:             # <<<<<<<<<<<<<<
 *             for k, v in items:
 *                 save(k)
 */
  }

  /* "cycloudpickle/cypickle.pyx":739
 *             return
 * 
 *         it = iter(items)             # <<<<<<<<<<<<<<
 *         while True:
 *             tmp = list(islice(it, self._BATCHSIZE))
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_it = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":740
 * 
 *         it = iter(items)
 *         while True:             # <<<<<<<<<<<<<<
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)
 */
  while (1) {

    /* "cycloudpickle/cypickle.pyx":741
 *         it = iter(items)
 *         while True:
 *             tmp = list(islice(it, self._BATCHSIZE))             # <<<<<<<<<<<<<<
 *             n = len(tmp)
 *             if n > 1:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_islice); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BATCHSIZE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_3 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_3 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_v_it);
    __Pyx_GIVEREF(__pyx_v_it);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, __pyx_v_it);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_tmp, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":742
 *         while True:
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)             # <<<<<<<<<<<<<<
 *             if n > 1:
 *                 write(MARK)
 */
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_tmp); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n = __pyx_t_3;

    /* "cycloudpickle/cypickle.pyx":743
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)
 *             if n > 1:             # <<<<<<<<<<<<<<
 *                 write(MARK)
 *                 for k, v in tmp:
 */
    __pyx_t_2 = ((__pyx_v_n > 1) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":744
 *             n = len(tmp)
 *             if n > 1:
 *                 write(MARK)             # <<<<<<<<<<<<<<
 *                 for k, v in tmp:
 *                     save(k)
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_1 = __pyx_v_write; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_13cycloudpickle_8cypickle_MARK); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_13cycloudpickle_8cypickle_MARK);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":745
 *             if n > 1:
 *                 write(MARK)
 *                 for k, v in tmp:             # <<<<<<<<<<<<<<
 *                     save(k)
 *                     save(v)
 */
      __pyx_t_5 = __pyx_v_tmp; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
      for (;;) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          #else
          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
          index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L13_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_9 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L14_unpacking_done;
          __pyx_L13_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_L14_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "cycloudpickle/cypickle.pyx":746
 *                 write(MARK)
 *                 for k, v in tmp:
 *                     save(k)             # <<<<<<<<<<<<<<
 *                     save(v)
 *                 write(SETITEMS)
 */
        __Pyx_INCREF(__pyx_v_save);
        __pyx_t_6 = __pyx_v_save; __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_INCREF(__pyx_v_k);
          __Pyx_GIVEREF(__pyx_v_k);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_k);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cycloudpickle/cypickle.pyx":747
 *                 for k, v in tmp:
 *                     save(k)
 *                     save(v)             # <<<<<<<<<<<<<<
 *                 write(SETITEMS)
 *             elif n:
 */
        __Pyx_INCREF(__pyx_v_save);
        __pyx_t_6 = __pyx_v_save; __pyx_t_8 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
          __Pyx_INCREF(__pyx_v_v);
          __Pyx_GIVEREF(__pyx_v_v);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_v);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cycloudpickle/cypickle.pyx":745
 *             if n > 1:
 *                 write(MARK)
 *                 for k, v in tmp:             # <<<<<<<<<<<<<<
 *                     save(k)
 *                     save(v)
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":748
 *                     save(k)
 *                     save(v)
 *                 write(SETITEMS)             # <<<<<<<<<<<<<<
 *             elif n:
 *                 k, v = tmp[0]
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_1 = __pyx_v_write; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_13cycloudpickle_8cypickle_SETITEMS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_SETITEMS);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_SETITEMS);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_13cycloudpickle_8cypickle_SETITEMS);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":743
 *             tmp = list(islice(it, self._BATCHSIZE))
 *             n = len(tmp)
 *             if n > 1:             # <<<<<<<<<<<<<<
 *                 write(MARK)
 *                 for k, v in tmp:
 */
      goto __pyx_L10;
    }

    /* "cycloudpickle/cypickle.pyx":749
 *                     save(v)
 *                 write(SETITEMS)
 *             elif n:             # <<<<<<<<<<<<<<
 *                 k, v = tmp[0]
 *                 save(k)
 */
    __pyx_t_2 = (__pyx_v_n != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":750
 *                 write(SETITEMS)
 *             elif n:
 *                 k, v = tmp[0]             # <<<<<<<<<<<<<<
 *                 save(k)
 *                 save(v)
 */
      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_tmp, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L15_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L16_unpacking_done;
        __pyx_L15_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L16_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cycloudpickle/cypickle.pyx":751
 *             elif n:
 *                 k, v = tmp[0]
 *                 save(k)             # <<<<<<<<<<<<<<
 *                 save(v)
 *                 write(SETITEM)
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_k);
        __Pyx_GIVEREF(__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_k);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":752
 *                 k, v = tmp[0]
 *                 save(k)
 *                 save(v)             # <<<<<<<<<<<<<<
 *                 write(SETITEM)
 *             # else tmp is empty, and we're done
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_v); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_v);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":753
 *                 save(k)
 *                 save(v)
 *                 write(SETITEM)             # <<<<<<<<<<<<<<
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_7 = __pyx_v_write; __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_13cycloudpickle_8cypickle_SETITEM); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_SETITEM);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_SETITEM);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_13cycloudpickle_8cypickle_SETITEM);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cypickle.pyx":749
 *                     save(v)
 *                 write(SETITEMS)
 *             elif n:             # <<<<<<<<<<<<<<
 *                 k, v = tmp[0]
 *                 save(k)
 */
    }
    __pyx_L10:;

    /* "cycloudpickle/cypickle.pyx":755
 *                 write(SETITEM)
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BATCHSIZE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":756
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:
 *                 return             # <<<<<<<<<<<<<<
 * 
 *     def save_set(self, obj):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":755
 *                 write(SETITEM)
 *             # else tmp is empty, and we're done
 *             if n < self._BATCHSIZE:             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
    }
  }

  /* "cycloudpickle/cypickle.pyx":727
 *     dispatch[dict] = save_dict
 * 
 *     def _batch_setitems(self, items):             # <<<<<<<<<<<<<<
 *         # Helper to batch up SETITEMS sequences; proto >= 1 only
 *         save = self.save
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler._batch_setitems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":758
 *                 return
 * 
 *     def save_set(self, obj):             # <<<<<<<<<<<<<<
 *         save = self.save
 *         write = self.write
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_43save_set(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_43save_set(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_set (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_42save_set(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_42save_set(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_it = NULL;
  PyObject *__pyx_v_batch = NULL;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_set", 0);

  /* "cycloudpickle/cypickle.pyx":759
 * 
 *     def save_set(self, obj):
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_save = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":760
 *     def save_set(self, obj):
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         if self.proto < 4:
 */
  __pyx_t_1 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":762
 *         write = self.write
 * 
 *         if self.proto < 4:             # <<<<<<<<<<<<<<
 *             self.save_reduce(set, (list(obj),), obj=obj)
 *             return
 */
  __pyx_t_2 = ((__pyx_v_self->proto < 4) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":763
 * 
 *         if self.proto < 4:
 *             self.save_reduce(set, (list(obj),), obj=obj)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_List(__pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)(&PySet_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PySet_Type)));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PySet_Type)));
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":764
 *         if self.proto < 4:
 *             self.save_reduce(set, (list(obj),), obj=obj)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         write(EMPTY_SET)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":762
 *         write = self.write
 * 
 *         if self.proto < 4:             # <<<<<<<<<<<<<<
 *             self.save_reduce(set, (list(obj),), obj=obj)
 *             return
 */
  }

  /* "cycloudpickle/cypickle.pyx":766
 *             return
 * 
 *         write(EMPTY_SET)             # <<<<<<<<<<<<<<
 *         self.memoize(obj)
 * 
 */
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_4 = __pyx_v_write; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_13cycloudpickle_8cypickle_EMPTY_SET); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_SET);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_SET);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_13cycloudpickle_8cypickle_EMPTY_SET);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":767
 * 
 *         write(EMPTY_SET)
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *         it = iter(obj)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":769
 *         self.memoize(obj)
 * 
 *         it = iter(obj)             # <<<<<<<<<<<<<<
 *         while True:
 *             batch = list(islice(it, self._BATCHSIZE))
 */
  __pyx_t_5 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_it = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":770
 * 
 *         it = iter(obj)
 *         while True:             # <<<<<<<<<<<<<<
 *             batch = list(islice(it, self._BATCHSIZE))
 *             n = len(batch)
 */
  while (1) {

    /* "cycloudpickle/cypickle.pyx":771
 *         it = iter(obj)
 *         while True:
 *             batch = list(islice(it, self._BATCHSIZE))             # <<<<<<<<<<<<<<
 *             n = len(batch)
 *             if n > 0:
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_islice); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BATCHSIZE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_it);
    __Pyx_GIVEREF(__pyx_v_it);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_it);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_batch, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cycloudpickle/cypickle.pyx":772
 *         while True:
 *             batch = list(islice(it, self._BATCHSIZE))
 *             n = len(batch)             # <<<<<<<<<<<<<<
 *             if n > 0:
 *                 write(MARK)
 */
    __pyx_t_6 = PyList_GET_SIZE(__pyx_v_batch); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n = __pyx_t_6;

    /* "cycloudpickle/cypickle.pyx":773
 *             batch = list(islice(it, self._BATCHSIZE))
 *             n = len(batch)
 *             if n > 0:             # <<<<<<<<<<<<<<
 *                 write(MARK)
 *                 for item in batch:
 */
    __pyx_t_2 = ((__pyx_v_n > 0) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":774
 *             n = len(batch)
 *             if n > 0:
 *                 write(MARK)             # <<<<<<<<<<<<<<
 *                 for item in batch:
 *                     save(item)
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_5 = __pyx_v_write; __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_13cycloudpickle_8cypickle_MARK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_13cycloudpickle_8cypickle_MARK);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cycloudpickle/cypickle.pyx":775
 *             if n > 0:
 *                 write(MARK)
 *                 for item in batch:             # <<<<<<<<<<<<<<
 *                     save(item)
 *                 write(ADDITEMS)
 */
      __pyx_t_4 = __pyx_v_batch; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      for (;;) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cycloudpickle/cypickle.pyx":776
 *                 write(MARK)
 *                 for item in batch:
 *                     save(item)             # <<<<<<<<<<<<<<
 *                 write(ADDITEMS)
 *             if n < self._BATCHSIZE:
 */
        __Pyx_INCREF(__pyx_v_save);
        __pyx_t_3 = __pyx_v_save; __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_INCREF(__pyx_v_item);
          __Pyx_GIVEREF(__pyx_v_item);
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_item);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cycloudpickle/cypickle.pyx":775
 *             if n > 0:
 *                 write(MARK)
 *                 for item in batch:             # <<<<<<<<<<<<<<
 *                     save(item)
 *                 write(ADDITEMS)
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cycloudpickle/cypickle.pyx":777
 *                 for item in batch:
 *                     save(item)
 *                 write(ADDITEMS)             # <<<<<<<<<<<<<<
 *             if n < self._BATCHSIZE:
 *                 return
 */
      __Pyx_INCREF(__pyx_v_write);
      __pyx_t_5 = __pyx_v_write; __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_13cycloudpickle_8cypickle_ADDITEMS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_ADDITEMS);
        __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_ADDITEMS);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_13cycloudpickle_8cypickle_ADDITEMS);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cycloudpickle/cypickle.pyx":773
 *             batch = list(islice(it, self._BATCHSIZE))
 *             n = len(batch)
 *             if n > 0:             # <<<<<<<<<<<<<<
 *                 write(MARK)
 *                 for item in batch:
 */
    }

    /* "cycloudpickle/cypickle.pyx":778
 *                     save(item)
 *                 write(ADDITEMS)
 *             if n < self._BATCHSIZE:             # <<<<<<<<<<<<<<
 *                 return
 *     dispatch[set] = save_set
 */
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BATCHSIZE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":779
 *                 write(ADDITEMS)
 *             if n < self._BATCHSIZE:
 *                 return             # <<<<<<<<<<<<<<
 *     dispatch[set] = save_set
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":778
 *                     save(item)
 *                 write(ADDITEMS)
 *             if n < self._BATCHSIZE:             # <<<<<<<<<<<<<<
 *                 return
 *     dispatch[set] = save_set
 */
    }
  }

  /* "cycloudpickle/cypickle.pyx":758
 *                 return
 * 
 *     def save_set(self, obj):             # <<<<<<<<<<<<<<
 *         save = self.save
 *         write = self.write
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_batch);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":782
 *     dispatch[set] = save_set
 * 
 *     def save_frozenset(self, obj):             # <<<<<<<<<<<<<<
 *         save = self.save
 *         write = self.write
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_45save_frozenset(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_45save_frozenset(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_frozenset (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_44save_frozenset(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_44save_frozenset(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_frozenset", 0);

  /* "cycloudpickle/cypickle.pyx":783
 * 
 *     def save_frozenset(self, obj):
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_save = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":784
 *     def save_frozenset(self, obj):
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         if self.proto < 4:
 */
  __pyx_t_1 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":786
 *         write = self.write
 * 
 *         if self.proto < 4:             # <<<<<<<<<<<<<<
 *             self.save_reduce(frozenset, (list(obj),), obj=obj)
 *             return
 */
  __pyx_t_2 = ((__pyx_v_self->proto < 4) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":787
 * 
 *         if self.proto < 4:
 *             self.save_reduce(frozenset, (list(obj),), obj=obj)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_List(__pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)(&PyFrozenSet_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyFrozenSet_Type)));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyFrozenSet_Type)));
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cypickle.pyx":788
 *         if self.proto < 4:
 *             self.save_reduce(frozenset, (list(obj),), obj=obj)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         write(MARK)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":786
 *         write = self.write
 * 
 *         if self.proto < 4:             # <<<<<<<<<<<<<<
 *             self.save_reduce(frozenset, (list(obj),), obj=obj)
 *             return
 */
  }

  /* "cycloudpickle/cypickle.pyx":790
 *             return
 * 
 *         write(MARK)             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             save(item)
 */
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_4 = __pyx_v_write; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_13cycloudpickle_8cypickle_MARK); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_13cycloudpickle_8cypickle_MARK);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":791
 * 
 *         write(MARK)
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             save(item)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
    __pyx_t_5 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cycloudpickle/cypickle.pyx":792
 *         write(MARK)
 *         for item in obj:
 *             save(item)             # <<<<<<<<<<<<<<
 * 
 *         if id(obj) in self.memo:
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_1 = __pyx_v_save; __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_item);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cycloudpickle/cypickle.pyx":791
 * 
 *         write(MARK)
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             save(item)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cycloudpickle/cypickle.pyx":794
 *             save(item)
 * 
 *         if id(obj) in self.memo:             # <<<<<<<<<<<<<<
 *             # If the object is already in the memo, this means it is
 *             # recursive. In this case, throw away everything we put on the
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_obj);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_v_self->memo == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_4, __pyx_v_self->memo, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = (__pyx_t_2 != 0);
  if (__pyx_t_9) {

    /* "cycloudpickle/cypickle.pyx":798
 *             # recursive. In this case, throw away everything we put on the
 *             # stack, and fetch the object back from the memo.
 *             write(POP_MARK + self.get(self.memo[id(obj)][0]))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->memo == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->memo, __pyx_t_3); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_POP_MARK, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_5 = __pyx_v_write; __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cycloudpickle/cypickle.pyx":799
 *             # stack, and fetch the object back from the memo.
 *             write(POP_MARK + self.get(self.memo[id(obj)][0]))
 *             return             # <<<<<<<<<<<<<<
 * 
 *         write(FROZENSET)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":794
 *             save(item)
 * 
 *         if id(obj) in self.memo:             # <<<<<<<<<<<<<<
 *             # If the object is already in the memo, this means it is
 *             # recursive. In this case, throw away everything we put on the
 */
  }

  /* "cycloudpickle/cypickle.pyx":801
 *             return
 * 
 *         write(FROZENSET)             # <<<<<<<<<<<<<<
 *         self.memoize(obj)
 *     dispatch[frozenset] = save_frozenset
 */
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_5 = __pyx_v_write; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_13cycloudpickle_8cypickle_FROZENSET); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_FROZENSET);
    __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_FROZENSET);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_13cycloudpickle_8cypickle_FROZENSET);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cycloudpickle/cypickle.pyx":802
 * 
 *         write(FROZENSET)
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 *     dispatch[frozenset] = save_frozenset
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cycloudpickle/cypickle.pyx":782
 *     dispatch[set] = save_set
 * 
 *     def save_frozenset(self, obj):             # <<<<<<<<<<<<<<
 *         save = self.save
 *         write = self.write
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_frozenset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":805
 *     dispatch[frozenset] = save_frozenset
 * 
 *     def save_global(self, obj, name=None):             # <<<<<<<<<<<<<<
 *         write = self.write
 *         memo = self.memo
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_47save_global(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_47save_global(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_global (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save_global") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_global", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_global", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_46save_global(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), __pyx_v_obj, __pyx_v_name);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_46save_global(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_write = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_memo = NULL;
  PyObject *__pyx_v_module_name = NULL;
  PyObject *__pyx_v_module = NULL;
  PyObject *__pyx_v_obj2 = NULL;
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_v_r_name_mapping = NULL;
  PyObject *__pyx_v_r_import_mapping = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_13cycloudpickle_8cypickle_whichmodule __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  struct __pyx_opt_args_13cycloudpickle_8cypickle__getattribute __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_global", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "cycloudpickle/cypickle.pyx":806
 * 
 *     def save_global(self, obj, name=None):
 *         write = self.write             # <<<<<<<<<<<<<<
 *         memo = self.memo
 * 
 */
  __pyx_t_1 = __pyx_v_self->write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":807
 *     def save_global(self, obj, name=None):
 *         write = self.write
 *         memo = self.memo             # <<<<<<<<<<<<<<
 * 
 *         if name is None and self.proto >= 4:
 */
  __pyx_t_1 = __pyx_v_self->memo;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_memo = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":809
 *         memo = self.memo
 * 
 *         if name is None and self.proto >= 4:             # <<<<<<<<<<<<<<
 *             name = getattr(obj, '__qualname__', None)
 *         if name is None:
 */
  __pyx_t_3 = (__pyx_v_name == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_self->proto >= 4) != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":810
 * 
 *         if name is None and self.proto >= 4:
 *             name = getattr(obj, '__qualname__', None)             # <<<<<<<<<<<<<<
 *         if name is None:
 *             name = obj.__name__
 */
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_qualname, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":809
 *         memo = self.memo
 * 
 *         if name is None and self.proto >= 4:             # <<<<<<<<<<<<<<
 *             name = getattr(obj, '__qualname__', None)
 *         if name is None:
 */
  }

  /* "cycloudpickle/cypickle.pyx":811
 *         if name is None and self.proto >= 4:
 *             name = getattr(obj, '__qualname__', None)
 *         if name is None:             # <<<<<<<<<<<<<<
 *             name = obj.__name__
 * 
 */
  __pyx_t_2 = (__pyx_v_name == Py_None);
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "cycloudpickle/cypickle.pyx":812
 *             name = getattr(obj, '__qualname__', None)
 *         if name is None:
 *             name = obj.__name__             # <<<<<<<<<<<<<<
 * 
 *         module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":811
 *         if name is None and self.proto >= 4:
 *             name = getattr(obj, '__qualname__', None)
 *         if name is None:             # <<<<<<<<<<<<<<
 *             name = obj.__name__
 * 
 */
  }

  /* "cycloudpickle/cypickle.pyx":814
 *             name = obj.__name__
 * 
 *         module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)             # <<<<<<<<<<<<<<
 *         try:
 *             __import__(module_name, level=0)
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.allow_qualname = (__pyx_v_self->proto >= 4);
  __pyx_t_1 = __pyx_f_13cycloudpickle_8cypickle_whichmodule(__pyx_v_obj, ((PyObject*)__pyx_v_name), &__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_module_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":815
 * 
 *         module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)
 *         try:             # <<<<<<<<<<<<<<
 *             __import__(module_name, level=0)
 *             module = sys.modules[module_name]
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "cycloudpickle/cypickle.pyx":816
 *         module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)
 *         try:
 *             __import__(module_name, level=0)             # <<<<<<<<<<<<<<
 *             module = sys.modules[module_name]
 *             obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_module_name);
      __Pyx_GIVEREF(__pyx_v_module_name);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module_name);
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_level, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cycloudpickle/cypickle.pyx":817
 *         try:
 *             __import__(module_name, level=0)
 *             module = sys.modules[module_name]             # <<<<<<<<<<<<<<
 *             obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)
 *         except (ImportError, KeyError, AttributeError):
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_modules); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_GetItem(__pyx_t_9, __pyx_v_module_name); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_module = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "cycloudpickle/cypickle.pyx":818
 *             __import__(module_name, level=0)
 *             module = sys.modules[module_name]
 *             obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)             # <<<<<<<<<<<<<<
 *         except (ImportError, KeyError, AttributeError):
 *             raise pickle.PicklingError(
 */
      if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __pyx_t_11.__pyx_n = 1;
      __pyx_t_11.allow_qualname = (__pyx_v_self->proto >= 4);
      __pyx_t_10 = __pyx_f_13cycloudpickle_8cypickle__getattribute(__pyx_v_module, ((PyObject*)__pyx_v_name), &__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_v_obj2 = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "cycloudpickle/cypickle.pyx":815
 * 
 *         module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)
 *         try:             # <<<<<<<<<<<<<<
 *             __import__(module_name, level=0)
 *             module = sys.modules[module_name]
 */
    }

    /* "cycloudpickle/cypickle.pyx":824
 *                 (obj, module_name, name))
 *         else:
 *             if obj2 is not obj:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "Can't pickle %r: it's not the same object as %s.%s" %
 */
    /*else:*/ {
      __pyx_t_4 = (__pyx_v_obj2 != __pyx_v_obj);
      __pyx_t_2 = (__pyx_t_4 != 0);
      if (__pyx_t_2) {

        /* "cycloudpickle/cypickle.pyx":825
 *         else:
 *             if obj2 is not obj:
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "Can't pickle %r: it's not the same object as %s.%s" %
 *                     (obj, module_name, name))
 */
        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "cycloudpickle/cypickle.pyx":827
 *                 raise pickle.PicklingError(
 *                     "Can't pickle %r: it's not the same object as %s.%s" %
 *                     (obj, module_name, name))             # <<<<<<<<<<<<<<
 * 
 *         if self.proto >= 2:
 */
        __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj);
        __Pyx_INCREF(__pyx_v_module_name);
        __Pyx_GIVEREF(__pyx_v_module_name);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_module_name);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_name);

        /* "cycloudpickle/cypickle.pyx":826
 *             if obj2 is not obj:
 *                 raise pickle.PicklingError(
 *                     "Can't pickle %r: it's not the same object as %s.%s" %             # <<<<<<<<<<<<<<
 *                     (obj, module_name, name))
 * 
 */
        __pyx_t_12 = PyUnicode_Format(__pyx_kp_u_Can_t_pickle_r_it_s_not_the_same, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        if (!__pyx_t_9) {
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL;
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_10, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}

        /* "cycloudpickle/cypickle.pyx":824
 *                 (obj, module_name, name))
 *         else:
 *             if obj2 is not obj:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "Can't pickle %r: it's not the same object as %s.%s" %
 */
      }
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L14_try_end;
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":819
 *             module = sys.modules[module_name]
 *             obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)
 *         except (ImportError, KeyError, AttributeError):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError(
 *                 "Can't pickle %r: it's not found as %s.%s" %
 */
    __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_ImportError) || PyErr_ExceptionMatches(__pyx_builtin_KeyError) || PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_14) {
      __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_global", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_13);

      /* "cycloudpickle/cypickle.pyx":820
 *             obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)
 *         except (ImportError, KeyError, AttributeError):
 *             raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                 "Can't pickle %r: it's not found as %s.%s" %
 *                 (obj, module_name, name))
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cycloudpickle/cypickle.pyx":822
 *             raise pickle.PicklingError(
 *                 "Can't pickle %r: it's not found as %s.%s" %
 *                 (obj, module_name, name))             # <<<<<<<<<<<<<<
 *         else:
 *             if obj2 is not obj:
 */
      __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj);
      __Pyx_INCREF(__pyx_v_module_name);
      __Pyx_GIVEREF(__pyx_v_module_name);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_module_name);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_name);

      /* "cycloudpickle/cypickle.pyx":821
 *         except (ImportError, KeyError, AttributeError):
 *             raise pickle.PicklingError(
 *                 "Can't pickle %r: it's not found as %s.%s" %             # <<<<<<<<<<<<<<
 *                 (obj, module_name, name))
 *         else:
 */
      __pyx_t_16 = PyUnicode_Format(__pyx_kp_u_Can_t_pickle_r_it_s_not_found_as, __pyx_t_9); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else {
        __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_GIVEREF(__pyx_t_16);
        PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_16);
        __pyx_t_16 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_Raise(__pyx_t_12, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
    }
    goto __pyx_L9_except_error;
    __pyx_L9_except_error:;

    /* "cycloudpickle/cypickle.pyx":815
 * 
 *         module_name = whichmodule(obj, name, allow_qualname=self.proto >= 4)
 *         try:             # <<<<<<<<<<<<<<
 *             __import__(module_name, level=0)
 *             module = sys.modules[module_name]
 */
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L14_try_end:;
  }

  /* "cycloudpickle/cypickle.pyx":829
 *                     (obj, module_name, name))
 * 
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             code = _extension_registry.get((module_name, name))
 *             if code:
 */
  __pyx_t_2 = ((__pyx_v_self->proto >= 2) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":830
 * 
 *         if self.proto >= 2:
 *             code = _extension_registry.get((module_name, name))             # <<<<<<<<<<<<<<
 *             if code:
 *                 assert code > 0
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_extension_registry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_module_name);
    __Pyx_GIVEREF(__pyx_v_module_name);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module_name);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_13);
    } else {
      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_code = __pyx_t_13;
    __pyx_t_13 = 0;

    /* "cycloudpickle/cypickle.pyx":831
 *         if self.proto >= 2:
 *             code = _extension_registry.get((module_name, name))
 *             if code:             # <<<<<<<<<<<<<<
 *                 assert code > 0
 *                 if code <= 0xff:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_code); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":832
 *             code = _extension_registry.get((module_name, name))
 *             if code:
 *                 assert code > 0             # <<<<<<<<<<<<<<
 *                 if code <= 0xff:
 *                     write(EXT1 + pack("<B", code))
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        __pyx_t_13 = PyObject_RichCompare(__pyx_v_code, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_2)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      #endif

      /* "cycloudpickle/cypickle.pyx":833
 *             if code:
 *                 assert code > 0
 *                 if code <= 0xff:             # <<<<<<<<<<<<<<
 *                     write(EXT1 + pack("<B", code))
 *                 elif code <= 0xffff:
 */
      __pyx_t_13 = PyObject_RichCompare(__pyx_v_code, __pyx_int_255, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_2) {

        /* "cycloudpickle/cypickle.pyx":834
 *                 assert code > 0
 *                 if code <= 0xff:
 *                     write(EXT1 + pack("<B", code))             # <<<<<<<<<<<<<<
 *                 elif code <= 0xffff:
 *                     write(EXT2 + pack("<H", code))
 */
        __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_1 = NULL;
        __pyx_t_18 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_18 = 1;
          }
        }
        __pyx_t_12 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_B);
        __Pyx_GIVEREF(__pyx_kp_u_B);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_18, __pyx_kp_u_B);
        __Pyx_INCREF(__pyx_v_code);
        __Pyx_GIVEREF(__pyx_v_code);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_18, __pyx_v_code);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_EXT1, __pyx_t_10); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_INCREF(__pyx_v_write);
        __pyx_t_10 = __pyx_v_write; __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_13);
        } else {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "cycloudpickle/cypickle.pyx":833
 *             if code:
 *                 assert code > 0
 *                 if code <= 0xff:             # <<<<<<<<<<<<<<
 *                     write(EXT1 + pack("<B", code))
 *                 elif code <= 0xffff:
 */
        goto __pyx_L20;
      }

      /* "cycloudpickle/cypickle.pyx":835
 *                 if code <= 0xff:
 *                     write(EXT1 + pack("<B", code))
 *                 elif code <= 0xffff:             # <<<<<<<<<<<<<<
 *                     write(EXT2 + pack("<H", code))
 *                 else:
 */
      __pyx_t_13 = PyObject_RichCompare(__pyx_v_code, __pyx_int_65535, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_2) {

        /* "cycloudpickle/cypickle.pyx":836
 *                     write(EXT1 + pack("<B", code))
 *                 elif code <= 0xffff:
 *                     write(EXT2 + pack("<H", code))             # <<<<<<<<<<<<<<
 *                 else:
 *                     write(EXT4 + pack("<i", code))
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_15 = NULL;
        __pyx_t_18 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
            __pyx_t_18 = 1;
          }
        }
        __pyx_t_12 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_15) {
          __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_15); __pyx_t_15 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_H);
        __Pyx_GIVEREF(__pyx_kp_u_H);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_18, __pyx_kp_u_H);
        __Pyx_INCREF(__pyx_v_code);
        __Pyx_GIVEREF(__pyx_v_code);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_18, __pyx_v_code);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_EXT2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_INCREF(__pyx_v_write);
        __pyx_t_10 = __pyx_v_write; __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_13);
        } else {
          __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "cycloudpickle/cypickle.pyx":835
 *                 if code <= 0xff:
 *                     write(EXT1 + pack("<B", code))
 *                 elif code <= 0xffff:             # <<<<<<<<<<<<<<
 *                     write(EXT2 + pack("<H", code))
 *                 else:
 */
        goto __pyx_L20;
      }

      /* "cycloudpickle/cypickle.pyx":838
 *                     write(EXT2 + pack("<H", code))
 *                 else:
 *                     write(EXT4 + pack("<i", code))             # <<<<<<<<<<<<<<
 *                 return
 *         # Non-ASCII identifiers are supported only with protocols >= 3.
 */
      /*else*/ {
        __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_1 = NULL;
        __pyx_t_18 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_18 = 1;
          }
        }
        __pyx_t_12 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_i);
        __Pyx_GIVEREF(__pyx_kp_u_i);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_18, __pyx_kp_u_i);
        __Pyx_INCREF(__pyx_v_code);
        __Pyx_GIVEREF(__pyx_v_code);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_18, __pyx_v_code);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_EXT4, __pyx_t_10); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_INCREF(__pyx_v_write);
        __pyx_t_10 = __pyx_v_write; __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_13);
        } else {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __pyx_L20:;

      /* "cycloudpickle/cypickle.pyx":839
 *                 else:
 *                     write(EXT4 + pack("<i", code))
 *                 return             # <<<<<<<<<<<<<<
 *         # Non-ASCII identifiers are supported only with protocols >= 3.
 *         if self.proto >= 4:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cypickle.pyx":831
 *         if self.proto >= 2:
 *             code = _extension_registry.get((module_name, name))
 *             if code:             # <<<<<<<<<<<<<<
 *                 assert code > 0
 *                 if code <= 0xff:
 */
    }

    /* "cycloudpickle/cypickle.pyx":829
 *                     (obj, module_name, name))
 * 
 *         if self.proto >= 2:             # <<<<<<<<<<<<<<
 *             code = _extension_registry.get((module_name, name))
 *             if code:
 */
  }

  /* "cycloudpickle/cypickle.pyx":841
 *                 return
 *         # Non-ASCII identifiers are supported only with protocols >= 3.
 *         if self.proto >= 4:             # <<<<<<<<<<<<<<
 *             self.save(module_name)
 *             self.save(name)
 */
  __pyx_t_2 = ((__pyx_v_self->proto >= 4) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":842
 *         # Non-ASCII identifiers are supported only with protocols >= 3.
 *         if self.proto >= 4:
 *             self.save(module_name)             # <<<<<<<<<<<<<<
 *             self.save(name)
 *             write(STACK_GLOBAL)
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_module_name); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
    } else {
      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_module_name);
      __Pyx_GIVEREF(__pyx_v_module_name);
      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_module_name);
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cycloudpickle/cypickle.pyx":843
 *         if self.proto >= 4:
 *             self.save(module_name)
 *             self.save(name)             # <<<<<<<<<<<<<<
 *             write(STACK_GLOBAL)
 *         elif self.proto >= 3:
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_15) {
      __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_name); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15); __pyx_t_15 = NULL;
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_name);
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cycloudpickle/cypickle.pyx":844
 *             self.save(module_name)
 *             self.save(name)
 *             write(STACK_GLOBAL)             # <<<<<<<<<<<<<<
 *         elif self.proto >= 3:
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
 */
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_10 = __pyx_v_write; __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
    } else {
      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL);
      __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL);
      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL);
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cycloudpickle/cypickle.pyx":841
 *                 return
 *         # Non-ASCII identifiers are supported only with protocols >= 3.
 *         if self.proto >= 4:             # <<<<<<<<<<<<<<
 *             self.save(module_name)
 *             self.save(name)
 */
    goto __pyx_L21;
  }

  /* "cycloudpickle/cypickle.pyx":845
 *             self.save(name)
 *             write(STACK_GLOBAL)
 *         elif self.proto >= 3:             # <<<<<<<<<<<<<<
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
 *                   bytes(name, "utf-8") + b'\n')
 */
  __pyx_t_2 = ((__pyx_v_self->proto >= 3) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":846
 *             write(STACK_GLOBAL)
 *         elif self.proto >= 3:
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +             # <<<<<<<<<<<<<<
 *                   bytes(name, "utf-8") + b'\n')
 *         else:
 */
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_module_name);
    __Pyx_GIVEREF(__pyx_v_module_name);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_module_name);
    __Pyx_INCREF(__pyx_kp_u_utf_8);
    __Pyx_GIVEREF(__pyx_kp_u_utf_8);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u_utf_8);
    __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_GLOBAL, __pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyNumber_Add(__pyx_t_10, __pyx_kp_b__7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":847
 *         elif self.proto >= 3:
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
 *                   bytes(name, "utf-8") + b'\n')             # <<<<<<<<<<<<<<
 *         else:
 *             if self.fix_imports:
 */
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name);
    __Pyx_INCREF(__pyx_kp_u_utf_8);
    __Pyx_GIVEREF(__pyx_kp_u_utf_8);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u_utf_8);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cypickle.pyx":846
 *             write(STACK_GLOBAL)
 *         elif self.proto >= 3:
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +             # <<<<<<<<<<<<<<
 *                   bytes(name, "utf-8") + b'\n')
 *         else:
 */
    __pyx_t_10 = PyNumber_Add(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cypickle.pyx":847
 *         elif self.proto >= 3:
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
 *                   bytes(name, "utf-8") + b'\n')             # <<<<<<<<<<<<<<
 *         else:
 *             if self.fix_imports:
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_10, __pyx_kp_b__7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_10 = __pyx_v_write; __pyx_t_15 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_15) {
      __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_13);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_15); __pyx_t_15 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cycloudpickle/cypickle.pyx":845
 *             self.save(name)
 *             write(STACK_GLOBAL)
 *         elif self.proto >= 3:             # <<<<<<<<<<<<<<
 *             write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
 *                   bytes(name, "utf-8") + b'\n')
 */
    goto __pyx_L21;
  }

  /* "cycloudpickle/cypickle.pyx":849
 *                   bytes(name, "utf-8") + b'\n')
 *         else:
 *             if self.fix_imports:             # <<<<<<<<<<<<<<
 *                 r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->fix_imports != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cypickle.pyx":850
 *         else:
 *             if self.fix_imports:
 *                 r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING             # <<<<<<<<<<<<<<
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
 *                 if (module_name, name) in r_name_mapping:
 */
      __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_compat_pickle); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_REVERSE_NAME_MAPPING); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_v_r_name_mapping = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "cycloudpickle/cypickle.pyx":851
 *             if self.fix_imports:
 *                 r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING             # <<<<<<<<<<<<<<
 *                 if (module_name, name) in r_name_mapping:
 *                     module_name, name = r_name_mapping[(module_name, name)]
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_compat_pickle); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_REVERSE_IMPORT_MAPPING); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_r_import_mapping = __pyx_t_13;
      __pyx_t_13 = 0;

      /* "cycloudpickle/cypickle.pyx":852
 *                 r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
 *                 if (module_name, name) in r_name_mapping:             # <<<<<<<<<<<<<<
 *                     module_name, name = r_name_mapping[(module_name, name)]
 *                 if module_name in r_import_mapping:
 */
      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_v_module_name);
      __Pyx_GIVEREF(__pyx_v_module_name);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_module_name);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_name);
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_13, __pyx_v_r_name_mapping, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_4 = (__pyx_t_2 != 0);
      if (__pyx_t_4) {

        /* "cycloudpickle/cypickle.pyx":853
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
 *                 if (module_name, name) in r_name_mapping:
 *                     module_name, name = r_name_mapping[(module_name, name)]             # <<<<<<<<<<<<<<
 *                 if module_name in r_import_mapping:
 *                     module_name = r_import_mapping[module_name]
 */
        __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_v_module_name);
        __Pyx_GIVEREF(__pyx_v_module_name);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_module_name);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_name);
        __pyx_t_10 = PyObject_GetItem(__pyx_v_r_name_mapping, __pyx_t_13); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
          PyObject* sequence = __pyx_t_10;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          #else
          __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          #endif
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_1 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_19 = Py_TYPE(__pyx_t_1)->tp_iternext;
          index = 0; __pyx_t_13 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_13)) goto __pyx_L24_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          index = 1; __pyx_t_12 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L24_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_12);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_19 = NULL;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L25_unpacking_done;
          __pyx_L24_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_19 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_L25_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_module_name, __pyx_t_13);
        __pyx_t_13 = 0;
        __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "cycloudpickle/cypickle.pyx":852
 *                 r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
 *                 if (module_name, name) in r_name_mapping:             # <<<<<<<<<<<<<<
 *                     module_name, name = r_name_mapping[(module_name, name)]
 *                 if module_name in r_import_mapping:
 */
      }

      /* "cycloudpickle/cypickle.pyx":854
 *                 if (module_name, name) in r_name_mapping:
 *                     module_name, name = r_name_mapping[(module_name, name)]
 *                 if module_name in r_import_mapping:             # <<<<<<<<<<<<<<
 *                     module_name = r_import_mapping[module_name]
 *             try:
 */
      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_module_name, __pyx_v_r_import_mapping, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = (__pyx_t_4 != 0);
      if (__pyx_t_2) {

        /* "cycloudpickle/cypickle.pyx":855
 *                     module_name, name = r_name_mapping[(module_name, name)]
 *                 if module_name in r_import_mapping:
 *                     module_name = r_import_mapping[module_name]             # <<<<<<<<<<<<<<
 *             try:
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 */
        __pyx_t_10 = PyObject_GetItem(__pyx_v_r_import_mapping, __pyx_v_module_name); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF_SET(__pyx_v_module_name, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "cycloudpickle/cypickle.pyx":854
 *                 if (module_name, name) in r_name_mapping:
 *                     module_name, name = r_name_mapping[(module_name, name)]
 *                 if module_name in r_import_mapping:             # <<<<<<<<<<<<<<
 *                     module_name = r_import_mapping[module_name]
 *             try:
 */
      }

      /* "cycloudpickle/cypickle.pyx":849
 *                   bytes(name, "utf-8") + b'\n')
 *         else:
 *             if self.fix_imports:             # <<<<<<<<<<<<<<
 *                 r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
 *                 r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
 */
    }

    /* "cycloudpickle/cypickle.pyx":856
 *                 if module_name in r_import_mapping:
 *                     module_name = r_import_mapping[module_name]
 *             try:             # <<<<<<<<<<<<<<
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 *                       bytes(name, "ascii") + b'\n')
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "cycloudpickle/cypickle.pyx":857
 *                     module_name = r_import_mapping[module_name]
 *             try:
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +             # <<<<<<<<<<<<<<
 *                       bytes(name, "ascii") + b'\n')
 *             except UnicodeEncodeError:
 */
        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_v_module_name);
        __Pyx_GIVEREF(__pyx_v_module_name);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_module_name);
        __Pyx_INCREF(__pyx_n_u_ascii);
        __Pyx_GIVEREF(__pyx_n_u_ascii);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_u_ascii);
        __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Add(__pyx_v_13cycloudpickle_8cypickle_GLOBAL, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Add(__pyx_t_12, __pyx_kp_b__7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "cycloudpickle/cypickle.pyx":858
 *             try:
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 *                       bytes(name, "ascii") + b'\n')             # <<<<<<<<<<<<<<
 *             except UnicodeEncodeError:
 *                 raise pickle.PicklingError(
 */
        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_name);
        __Pyx_INCREF(__pyx_n_u_ascii);
        __Pyx_GIVEREF(__pyx_n_u_ascii);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_u_ascii);
        __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "cycloudpickle/cypickle.pyx":857
 *                     module_name = r_import_mapping[module_name]
 *             try:
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +             # <<<<<<<<<<<<<<
 *                       bytes(name, "ascii") + b'\n')
 *             except UnicodeEncodeError:
 */
        __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cycloudpickle/cypickle.pyx":858
 *             try:
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 *                       bytes(name, "ascii") + b'\n')             # <<<<<<<<<<<<<<
 *             except UnicodeEncodeError:
 *                 raise pickle.PicklingError(
 */
        __pyx_t_1 = PyNumber_Add(__pyx_t_12, __pyx_kp_b__7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_INCREF(__pyx_v_write);
        __pyx_t_12 = __pyx_v_write; __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else {
          __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cycloudpickle/cypickle.pyx":856
 *                 if module_name in r_import_mapping:
 *                     module_name = r_import_mapping[module_name]
 *             try:             # <<<<<<<<<<<<<<
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 *                       bytes(name, "ascii") + b'\n')
 */
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L34_try_end;
      __pyx_L27_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cycloudpickle/cypickle.pyx":859
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 *                       bytes(name, "ascii") + b'\n')
 *             except UnicodeEncodeError:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "can't pickle global identifier '%s.%s' using "
 */
      __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError);
      if (__pyx_t_14) {
        __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_global", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_12, &__pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GOTREF(__pyx_t_15);

        /* "cycloudpickle/cypickle.pyx":860
 *                       bytes(name, "ascii") + b'\n')
 *             except UnicodeEncodeError:
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "can't pickle global identifier '%s.%s' using "
 *                     "pickle protocol %i" % (module, name, self.proto))
 */
        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "cycloudpickle/cypickle.pyx":862
 *                 raise pickle.PicklingError(
 *                     "can't pickle global identifier '%s.%s' using "
 *                     "pickle protocol %i" % (module, name, self.proto))             # <<<<<<<<<<<<<<
 * 
 *         self.memoize(obj)
 */
        __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->proto); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_INCREF(__pyx_v_module);
        __Pyx_GIVEREF(__pyx_v_module);
        PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_module);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_13);
        __pyx_t_13 = 0;
        __pyx_t_13 = PyUnicode_Format(__pyx_kp_u_can_t_pickle_global_identifier_s, __pyx_t_16); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_16 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_16)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
          }
        }
        if (!__pyx_t_16) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_16); __pyx_t_16 = NULL;
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
      }
      goto __pyx_L29_except_error;
      __pyx_L29_except_error:;

      /* "cycloudpickle/cypickle.pyx":856
 *                 if module_name in r_import_mapping:
 *                     module_name = r_import_mapping[module_name]
 *             try:             # <<<<<<<<<<<<<<
 *                 write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
 *                       bytes(name, "ascii") + b'\n')
 */
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L34_try_end:;
    }
  }
  __pyx_L21:;

  /* "cycloudpickle/cypickle.pyx":864
 *                     "pickle protocol %i" % (module, name, self.proto))
 * 
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *     def save_type(self, obj):
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_obj); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_obj);
    __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cycloudpickle/cypickle.pyx":805
 *     dispatch[frozenset] = save_frozenset
 * 
 *     def save_global(self, obj, name=None):             # <<<<<<<<<<<<<<
 *         write = self.write
 *         memo = self.memo
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_global", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_memo);
  __Pyx_XDECREF(__pyx_v_module_name);
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_obj2);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_r_name_mapping);
  __Pyx_XDECREF(__pyx_v_r_import_mapping);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cypickle.pyx":866
 *         self.memoize(obj)
 * 
 *     def save_type(self, obj):             # <<<<<<<<<<<<<<
 *         if obj is type(None):
 *             return self.save_reduce(type, (None,), obj=obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_49save_type(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_8cypickle_7Pickler_49save_type(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_type (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_8cypickle_7Pickler_48save_type(((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_8cypickle_7Pickler_48save_type(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_type", 0);

  /* "cycloudpickle/cypickle.pyx":867
 * 
 *     def save_type(self, obj):
 *         if obj is type(None):             # <<<<<<<<<<<<<<
 *             return self.save_reduce(type, (None,), obj=obj)
 *         elif obj is type(NotImplemented):
 */
  __pyx_t_1 = (__pyx_v_obj == ((PyObject *)Py_TYPE(Py_None)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":868
 *     def save_type(self, obj):
 *         if obj is type(None):
 *             return self.save_reduce(type, (None,), obj=obj)             # <<<<<<<<<<<<<<
 *         elif obj is type(NotImplemented):
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)(&PyType_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyType_Type)));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyType_Type)));
    __Pyx_INCREF(__pyx_tuple__21);
    __Pyx_GIVEREF(__pyx_tuple__21);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_tuple__21);
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":867
 * 
 *     def save_type(self, obj):
 *         if obj is type(None):             # <<<<<<<<<<<<<<
 *             return self.save_reduce(type, (None,), obj=obj)
 *         elif obj is type(NotImplemented):
 */
  }

  /* "cycloudpickle/cypickle.pyx":869
 *         if obj is type(None):
 *             return self.save_reduce(type, (None,), obj=obj)
 *         elif obj is type(NotImplemented):             # <<<<<<<<<<<<<<
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 *         elif obj is type(...):
 */
  __pyx_t_2 = (__pyx_v_obj == ((PyObject *)Py_TYPE(__pyx_builtin_NotImplemented)));
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cypickle.pyx":870
 *             return self.save_reduce(type, (None,), obj=obj)
 *         elif obj is type(NotImplemented):
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)             # <<<<<<<<<<<<<<
 *         elif obj is type(...):
 *             return self.save_reduce(type, (...,), obj=obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __Pyx_GIVEREF(__pyx_builtin_NotImplemented);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_builtin_NotImplemented);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)(&PyType_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyType_Type)));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyType_Type)));
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":869
 *         if obj is type(None):
 *             return self.save_reduce(type, (None,), obj=obj)
 *         elif obj is type(NotImplemented):             # <<<<<<<<<<<<<<
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 *         elif obj is type(...):
 */
  }

  /* "cycloudpickle/cypickle.pyx":871
 *         elif obj is type(NotImplemented):
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 *         elif obj is type(...):             # <<<<<<<<<<<<<<
 *             return self.save_reduce(type, (...,), obj=obj)
 *         return self.save_global(obj)
 */
  __pyx_t_1 = (__pyx_v_obj == ((PyObject *)Py_TYPE(Py_Ellipsis)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cypickle.pyx":872
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 *         elif obj is type(...):
 *             return self.save_reduce(type, (...,), obj=obj)             # <<<<<<<<<<<<<<
 *         return self.save_global(obj)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)(&PyType_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyType_Type)));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyType_Type)));
    __Pyx_INCREF(__pyx_tuple__22);
    __Pyx_GIVEREF(__pyx_tuple__22);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_tuple__22);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_obj, __pyx_v_obj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cypickle.pyx":871
 *         elif obj is type(NotImplemented):
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 *         elif obj is type(...):             # <<<<<<<<<<<<<<
 *             return self.save_reduce(type, (...,), obj=obj)
 *         return self.save_global(obj)
 */
  }

  /* "cycloudpickle/cypickle.pyx":873
 *         elif obj is type(...):
 *             return self.save_reduce(type, (...,), obj=obj)
 *         return self.save_global(obj)             # <<<<<<<<<<<<<<
 * 
 *     dispatch[FunctionType] = save_global
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_global); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cypickle.pyx":866
 *         self.memoize(obj)
 * 
 *     def save_type(self, obj):             # <<<<<<<<<<<<<<
 *         if obj is type(None):
 *             return self.save_reduce(type, (None,), obj=obj)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cypickle.Pickler.save_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_13cycloudpickle_8cypickle__Framer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_13cycloudpickle_8cypickle__Framer *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)o);
  p->file_write = Py_None; Py_INCREF(Py_None);
  p->current_frame = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_13cycloudpickle_8cypickle__Framer(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_8cypickle__Framer *p = (struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->file_write);
  Py_CLEAR(p->current_frame);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_13cycloudpickle_8cypickle__Framer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_8cypickle__Framer *p = (struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)o;
  if (p->file_write) {
    e = (*v)(p->file_write, a); if (e) return e;
  }
  if (p->current_frame) {
    e = (*v)(p->current_frame, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_8cypickle__Framer(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_8cypickle__Framer *p = (struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)o;
  tmp = ((PyObject*)p->file_write);
  p->file_write = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_frame);
  p->current_frame = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_13cycloudpickle_8cypickle__Framer[] = {
  {"start_framing", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7_Framer_3start_framing, METH_NOARGS, 0},
  {"end_framing", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7_Framer_5end_framing, METH_NOARGS, 0},
  {"commit_frame", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7_Framer_7commit_frame, METH_VARARGS|METH_KEYWORDS, 0},
  {"write", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7_Framer_9write, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_13cycloudpickle_8cypickle__Framer = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cypickle._Framer", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_8cypickle__Framer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_8cypickle__Framer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_13cycloudpickle_8cypickle__Framer, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_8cypickle__Framer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_13cycloudpickle_8cypickle__Framer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_13cycloudpickle_8cypickle_7_Framer_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cycloudpickle_8cypickle__Framer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_13cycloudpickle_8cypickle_Pickler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)o);
  p->_file_write = Py_None; Py_INCREF(Py_None);
  p->framer = ((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)Py_None); Py_INCREF(Py_None);
  p->write = Py_None; Py_INCREF(Py_None);
  p->memo = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_13cycloudpickle_8cypickle_Pickler(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *p = (struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_file_write);
  Py_CLEAR(p->framer);
  Py_CLEAR(p->write);
  Py_CLEAR(p->memo);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_13cycloudpickle_8cypickle_Pickler(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *p = (struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)o;
  if (p->_file_write) {
    e = (*v)(p->_file_write, a); if (e) return e;
  }
  if (p->framer) {
    e = (*v)(((PyObject*)p->framer), a); if (e) return e;
  }
  if (p->write) {
    e = (*v)(p->write, a); if (e) return e;
  }
  if (p->memo) {
    e = (*v)(p->memo, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_8cypickle_Pickler(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *p = (struct __pyx_obj_13cycloudpickle_8cypickle_Pickler *)o;
  tmp = ((PyObject*)p->_file_write);
  p->_file_write = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->framer);
  p->framer = ((struct __pyx_obj_13cycloudpickle_8cypickle__Framer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->write);
  p->write = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->memo);
  p->memo = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_13cycloudpickle_8cypickle_Pickler[] = {
  {"clear_memo", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_3clear_memo, METH_NOARGS, __pyx_doc_13cycloudpickle_8cypickle_7Pickler_2clear_memo},
  {"dump", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_5dump, METH_O, __pyx_doc_13cycloudpickle_8cypickle_7Pickler_4dump},
  {"memoize", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_7memoize, METH_O, __pyx_doc_13cycloudpickle_8cypickle_7Pickler_6memoize},
  {"put", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_9put, METH_O, 0},
  {"get", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_11get, METH_O, 0},
  {"save", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_13save, METH_VARARGS|METH_KEYWORDS, 0},
  {"persistent_id", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_15persistent_id, METH_O, 0},
  {"save_pers", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_17save_pers, METH_O, 0},
  {"save_reduce", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_19save_reduce, METH_VARARGS|METH_KEYWORDS, 0},
  {"save_none", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_21save_none, METH_O, 0},
  {"save_bool", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_23save_bool, METH_O, 0},
  {"save_long", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_25save_long, METH_O, 0},
  {"save_float", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_27save_float, METH_O, 0},
  {"save_bytes", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_29save_bytes, METH_O, 0},
  {"save_str", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_31save_str, METH_O, 0},
  {"save_tuple", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_33save_tuple, METH_O, 0},
  {"save_list", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_35save_list, METH_O, 0},
  {"_batch_appends", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_37_batch_appends, METH_O, 0},
  {"save_dict", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_39save_dict, METH_O, 0},
  {"_batch_setitems", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_41_batch_setitems, METH_O, 0},
  {"save_set", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_43save_set, METH_O, 0},
  {"save_frozenset", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_45save_frozenset, METH_O, 0},
  {"save_global", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_47save_global, METH_VARARGS|METH_KEYWORDS, 0},
  {"save_type", (PyCFunction)__pyx_pw_13cycloudpickle_8cypickle_7Pickler_49save_type, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_13cycloudpickle_8cypickle_Pickler = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cypickle.Pickler", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_8cypickle_Pickler, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_13cycloudpickle_8cypickle_Pickler, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_8cypickle_Pickler, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_13cycloudpickle_8cypickle_Pickler, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_13cycloudpickle_8cypickle_7Pickler_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cycloudpickle_8cypickle_Pickler, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "cypickle",
    __pyx_k_This_file_is_an_adaptation_of_p, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_b_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 0, 0},
  {&__pyx_kp_b_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0, 0},
  {&__pyx_kp_u_1_0, __pyx_k_1_0, sizeof(__pyx_k_1_0), 0, 1, 0, 0},
  {&__pyx_kp_u_1_1, __pyx_k_1_1, sizeof(__pyx_k_1_1), 0, 1, 0, 0},
  {&__pyx_kp_u_1_2, __pyx_k_1_2, sizeof(__pyx_k_1_2), 0, 1, 0, 0},
  {&__pyx_kp_u_1_3, __pyx_k_1_3, sizeof(__pyx_k_1_3), 0, 1, 0, 0},
  {&__pyx_kp_b_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0, 0},
  {&__pyx_kp_u_2_0, __pyx_k_2_0, sizeof(__pyx_k_2_0), 0, 1, 0, 0},
  {&__pyx_kp_u_3_0, __pyx_k_3_0, sizeof(__pyx_k_3_0), 0, 1, 0, 0},
  {&__pyx_kp_u_4_0, __pyx_k_4_0, sizeof(__pyx_k_4_0), 0, 1, 0, 0},
  {&__pyx_kp_u_A_Z_A_Z0_9, __pyx_k_A_Z_A_Z0_9, sizeof(__pyx_k_A_Z_A_Z0_9), 0, 1, 0, 0},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_kp_u_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 1, 0, 0},
  {&__pyx_n_s_BATCHSIZE, __pyx_k_BATCHSIZE, sizeof(__pyx_k_BATCHSIZE), 0, 0, 1, 1},
  {&__pyx_n_b_B_2, __pyx_k_B_2, sizeof(__pyx_k_B_2), 0, 0, 0, 1},
  {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1},
  {&__pyx_n_b_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 0, 1},
  {&__pyx_kp_u_Can_t_get_attribute_r_on_r, __pyx_k_Can_t_get_attribute_r_on_r, sizeof(__pyx_k_Can_t_get_attribute_r_on_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_get_local_attribute_r_on_r, __pyx_k_Can_t_get_local_attribute_r_on_r, sizeof(__pyx_k_Can_t_get_local_attribute_r_on_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_get_qualified_attribute_r, __pyx_k_Can_t_get_qualified_attribute_r, sizeof(__pyx_k_Can_t_get_qualified_attribute_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_pickle_r_it_s_not_found_as, __pyx_k_Can_t_pickle_r_it_s_not_found_as, sizeof(__pyx_k_Can_t_pickle_r_it_s_not_found_as), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_pickle_r_it_s_not_the_same, __pyx_k_Can_t_pickle_r_it_s_not_the_same, sizeof(__pyx_k_Can_t_pickle_r_it_s_not_the_same), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_pickle_r_object_r, __pyx_k_Can_t_pickle_r_object_r, sizeof(__pyx_k_Can_t_pickle_r_object_r), 0, 1, 0, 0},
  {&__pyx_n_b_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 0, 1},
  {&__pyx_n_s_FRAME_SIZE_TARGET, __pyx_k_FRAME_SIZE_TARGET, sizeof(__pyx_k_FRAME_SIZE_TARGET), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionType, __pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 0, 1, 1},
  {&__pyx_n_b_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 0, 1},
  {&__pyx_kp_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 0},
  {&__pyx_kp_u_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 1, 0, 0},
  {&__pyx_n_b_I00, __pyx_k_I00, sizeof(__pyx_k_I00), 0, 0, 0, 1},
  {&__pyx_n_b_I01, __pyx_k_I01, sizeof(__pyx_k_I01), 0, 0, 0, 1},
  {&__pyx_n_b_I_2, __pyx_k_I_2, sizeof(__pyx_k_I_2), 0, 0, 0, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_b_J, __pyx_k_J, sizeof(__pyx_k_J), 0, 0, 0, 1},
  {&__pyx_n_b_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 0, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_b_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 0, 1},
  {&__pyx_n_b_L_2, __pyx_k_L_2, sizeof(__pyx_k_L_2), 0, 0, 0, 1},
  {&__pyx_n_b_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 0, 1},
  {&__pyx_n_b_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 0, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_b_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 0, 1},
  {&__pyx_n_u_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 1, 0, 1},
  {&__pyx_n_u_Pickler, __pyx_k_Pickler, sizeof(__pyx_k_Pickler), 0, 1, 0, 1},
  {&__pyx_n_s_PicklingError, __pyx_k_PicklingError, sizeof(__pyx_k_PicklingError), 0, 0, 1, 1},
  {&__pyx_n_u_PicklingError, __pyx_k_PicklingError, sizeof(__pyx_k_PicklingError), 0, 1, 0, 1},
  {&__pyx_kp_u_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 1, 0, 0},
  {&__pyx_n_b_Q_2, __pyx_k_Q_2, sizeof(__pyx_k_Q_2), 0, 0, 0, 1},
  {&__pyx_n_b_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 0, 1},
  {&__pyx_n_s_REVERSE_IMPORT_MAPPING, __pyx_k_REVERSE_IMPORT_MAPPING, sizeof(__pyx_k_REVERSE_IMPORT_MAPPING), 0, 0, 1, 1},
  {&__pyx_n_s_REVERSE_NAME_MAPPING, __pyx_k_REVERSE_NAME_MAPPING, sizeof(__pyx_k_REVERSE_NAME_MAPPING), 0, 0, 1, 1},
  {&__pyx_n_b_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 0, 1},
  {&__pyx_n_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 1},
  {&__pyx_kp_u_Tuple_returned_by_s_must_have_tw, __pyx_k_Tuple_returned_by_s_must_have_tw, sizeof(__pyx_k_Tuple_returned_by_s_must_have_tw), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_b_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 0, 1},
  {&__pyx_n_s_UnicodeEncodeError, __pyx_k_UnicodeEncodeError, sizeof(__pyx_k_UnicodeEncodeError), 0, 0, 1, 1},
  {&__pyx_n_u_Unpickler, __pyx_k_Unpickler, sizeof(__pyx_k_Unpickler), 0, 1, 0, 1},
  {&__pyx_n_u_UnpicklingError, __pyx_k_UnpicklingError, sizeof(__pyx_k_UnpicklingError), 0, 1, 0, 1},
  {&__pyx_n_b_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 0, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_b_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 0, 1},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_b__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 0, 0},
  {&__pyx_kp_b__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 0, 0},
  {&__pyx_kp_b__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 0, 0},
  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
  {&__pyx_kp_b__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 0, 0},
  {&__pyx_kp_b__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 0, 0},
  {&__pyx_kp_b__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 0, 0},
  {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_b__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 0, 0},
  {&__pyx_kp_b__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 0, 0},
  {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0},
  {&__pyx_kp_b__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 0, 0},
  {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0},
  {&__pyx_kp_b__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 0, 0},
  {&__pyx_kp_b__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 0, 0},
  {&__pyx_kp_b__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 0, 0},
  {&__pyx_kp_b__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 0, 0},
  {&__pyx_kp_b__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 0, 0},
  {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_kp_b__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 0, 0},
  {&__pyx_kp_b__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 0, 0},
  {&__pyx_kp_b__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 0, 0},
  {&__pyx_kp_b__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 0, 0},
  {&__pyx_kp_b__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 0, 0},
  {&__pyx_kp_b__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 0, 0},
  {&__pyx_kp_b__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 0, 0},
  {&__pyx_kp_b__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 0, 0},
  {&__pyx_kp_b__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 0, 0, 0},
  {&__pyx_kp_b__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 0, 0},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_n_b_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 0, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_kp_u_args_0_from___newobj___args_has, __pyx_k_args_0_from___newobj___args_has, sizeof(__pyx_k_args_0_from___newobj___args_has), 0, 1, 0, 0},
  {&__pyx_kp_u_args_0_from___newobj___args_has_2, __pyx_k_args_0_from___newobj___args_has_2, sizeof(__pyx_k_args_0_from___newobj___args_has_2), 0, 1, 0, 0},
  {&__pyx_kp_u_args_0_from_args_has_no___new, __pyx_k_args_0_from_args_has_no___new, sizeof(__pyx_k_args_0_from_args_has_no___new), 0, 1, 0, 0},
  {&__pyx_kp_u_args_0_from_args_has_the_wrong_c, __pyx_k_args_0_from_args_has_the_wrong_c, sizeof(__pyx_k_args_0_from_args_has_the_wrong_c), 0, 1, 0, 0},
  {&__pyx_kp_u_args_from_save_reduce_must_be_a, __pyx_k_args_from_save_reduce_must_be_a, sizeof(__pyx_k_args_from_save_reduce_must_be_a), 0, 1, 0, 0},
  {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1},
  {&__pyx_n_b_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 0, 1},
  {&__pyx_n_s_batch_appends, __pyx_k_batch_appends, sizeof(__pyx_k_batch_appends), 0, 0, 1, 1},
  {&__pyx_n_s_batch_setitems, __pyx_k_batch_setitems, sizeof(__pyx_k_batch_setitems), 0, 0, 1, 1},
  {&__pyx_n_s_bit_length, __pyx_k_bit_length, sizeof(__pyx_k_bit_length), 0, 0, 1, 1},
  {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 0, 0, 1, 1},
  {&__pyx_n_b_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 0, 1},
  {&__pyx_kp_u_can_t_pickle_global_identifier_s, __pyx_k_can_t_pickle_global_identifier_s, sizeof(__pyx_k_can_t_pickle_global_identifier_s), 0, 1, 0, 0},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1},
  {&__pyx_n_s_commit_frame, __pyx_k_commit_frame, sizeof(__pyx_k_commit_frame), 0, 0, 1, 1},
  {&__pyx_n_s_compat_pickle, __pyx_k_compat_pickle, sizeof(__pyx_k_compat_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_copyreg, __pyx_k_copyreg, sizeof(__pyx_k_copyreg), 0, 0, 1, 1},
  {&__pyx_kp_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 0},
  {&__pyx_n_b_d_2, __pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 0, 0, 1},
  {&__pyx_n_s_dictitems, __pyx_k_dictitems, sizeof(__pyx_k_dictitems), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch, __pyx_k_dispatch, sizeof(__pyx_k_dispatch), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch_table, __pyx_k_dispatch_table, sizeof(__pyx_k_dispatch_table), 0, 0, 1, 1},
  {&__pyx_n_u_dispatch_table, __pyx_k_dispatch_table, sizeof(__pyx_k_dispatch_table), 0, 1, 0, 1},
  {&__pyx_n_u_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 1, 0, 1},
  {&__pyx_n_u_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 1, 0, 1},
  {&__pyx_n_b_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 0, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end_framing, __pyx_k_end_framing, sizeof(__pyx_k_end_framing), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_s_extension_cache, __pyx_k_extension_cache, sizeof(__pyx_k_extension_cache), 0, 0, 1, 1},
  {&__pyx_n_s_extension_registry, __pyx_k_extension_registry, sizeof(__pyx_k_extension_registry), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_kp_u_file_must_have_a_write_attribute, __pyx_k_file_must_have_a_write_attribute, sizeof(__pyx_k_file_must_have_a_write_attribute), 0, 1, 0, 0},
  {&__pyx_n_s_file_write, __pyx_k_file_write, sizeof(__pyx_k_file_write), 0, 0, 1, 1},
  {&__pyx_n_s_fix_imports, __pyx_k_fix_imports, sizeof(__pyx_k_fix_imports), 0, 0, 1, 1},
  {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_kp_u_func_from_save_reduce_must_be_ca, __pyx_k_func_from_save_reduce_must_be_ca, sizeof(__pyx_k_func_from_save_reduce_must_be_ca), 0, 1, 0, 0},
  {&__pyx_n_b_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 0, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_getbuffer, __pyx_k_getbuffer, sizeof(__pyx_k_getbuffer), 0, 0, 1, 1},
  {&__pyx_n_b_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 0, 1},
  {&__pyx_kp_u_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 1, 0, 0},
  {&__pyx_n_b_i_2, __pyx_k_i_2, sizeof(__pyx_k_i_2), 0, 0, 0, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_inverted_registry, __pyx_k_inverted_registry, sizeof(__pyx_k_inverted_registry), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_islice, __pyx_k_islice, sizeof(__pyx_k_islice), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_b_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 0, 1},
  {&__pyx_n_b_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 0, 1},
  {&__pyx_n_u_latin1, __pyx_k_latin1, sizeof(__pyx_k_latin1), 0, 1, 0, 1},
  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
  {&__pyx_n_s_listitems, __pyx_k_listitems, sizeof(__pyx_k_listitems), 0, 0, 1, 1},
  {&__pyx_n_u_little, __pyx_k_little, sizeof(__pyx_k_little), 0, 1, 0, 1},
  {&__pyx_n_u_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 1, 0, 1},
  {&__pyx_n_u_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 1, 0, 1},
  {&__pyx_kp_u_locals, __pyx_k_locals, sizeof(__pyx_k_locals), 0, 1, 0, 0},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_u_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 1, 0, 1},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1},
  {&__pyx_n_s_memoize, __pyx_k_memoize, sizeof(__pyx_k_memoize), 0, 0, 1, 1},
  {&__pyx_n_u_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 1, 0, 1},
  {&__pyx_n_s_modules, __pyx_k_modules, sizeof(__pyx_k_modules), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 1, 0, 1},
  {&__pyx_n_u_newobj, __pyx_k_newobj, sizeof(__pyx_k_newobj), 0, 1, 0, 1},
  {&__pyx_n_u_newobj_ex, __pyx_k_newobj_ex, sizeof(__pyx_k_newobj_ex), 0, 1, 0, 1},
  {&__pyx_n_b_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 0, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_b_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 0, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_persistent_id, __pyx_k_persistent_id, sizeof(__pyx_k_persistent_id), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_kp_u_pickle_protocol_must_be_d, __pyx_k_pickle_protocol_must_be_d, sizeof(__pyx_k_pickle_protocol_must_be_d), 0, 1, 0, 0},
  {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1},
  {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1},
  {&__pyx_n_b_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 0, 1},
  {&__pyx_n_u_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 0, 1},
  {&__pyx_n_b_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 0, 1},
  {&__pyx_kp_u_raw_unicode_escape, __pyx_k_raw_unicode_escape, sizeof(__pyx_k_raw_unicode_escape), 0, 1, 0, 0},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_u_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 1, 0, 1},
  {&__pyx_n_u_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 0, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_b_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 0, 1},
  {&__pyx_kp_u_s_must_return_string_or_tuple, __pyx_k_s_must_return_string_or_tuple, sizeof(__pyx_k_s_must_return_string_or_tuple), 0, 1, 0, 0},
  {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1},
  {&__pyx_n_s_save_bool, __pyx_k_save_bool, sizeof(__pyx_k_save_bool), 0, 0, 1, 1},
  {&__pyx_n_s_save_bytes, __pyx_k_save_bytes, sizeof(__pyx_k_save_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_save_dict, __pyx_k_save_dict, sizeof(__pyx_k_save_dict), 0, 0, 1, 1},
  {&__pyx_n_s_save_float, __pyx_k_save_float, sizeof(__pyx_k_save_float), 0, 0, 1, 1},
  {&__pyx_n_s_save_frozenset, __pyx_k_save_frozenset, sizeof(__pyx_k_save_frozenset), 0, 0, 1, 1},
  {&__pyx_n_s_save_global, __pyx_k_save_global, sizeof(__pyx_k_save_global), 0, 0, 1, 1},
  {&__pyx_n_s_save_list, __pyx_k_save_list, sizeof(__pyx_k_save_list), 0, 0, 1, 1},
  {&__pyx_n_s_save_long, __pyx_k_save_long, sizeof(__pyx_k_save_long), 0, 0, 1, 1},
  {&__pyx_n_s_save_none, __pyx_k_save_none, sizeof(__pyx_k_save_none), 0, 0, 1, 1},
  {&__pyx_n_s_save_pers, __pyx_k_save_pers, sizeof(__pyx_k_save_pers), 0, 0, 1, 1},
  {&__pyx_n_s_save_persistent_id, __pyx_k_save_persistent_id, sizeof(__pyx_k_save_persistent_id), 0, 0, 1, 1},
  {&__pyx_n_s_save_reduce, __pyx_k_save_reduce, sizeof(__pyx_k_save_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_save_set, __pyx_k_save_set, sizeof(__pyx_k_save_set), 0, 0, 1, 1},
  {&__pyx_n_s_save_str, __pyx_k_save_str, sizeof(__pyx_k_save_str), 0, 0, 1, 1},
  {&__pyx_n_s_save_tuple, __pyx_k_save_tuple, sizeof(__pyx_k_save_tuple), 0, 0, 1, 1},
  {&__pyx_n_s_save_type, __pyx_k_save_type, sizeof(__pyx_k_save_type), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_signed, __pyx_k_signed, sizeof(__pyx_k_signed), 0, 0, 1, 1},
  {&__pyx_n_s_start_framing, __pyx_k_start_framing, sizeof(__pyx_k_start_framing), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_u_surrogatepass, __pyx_k_surrogatepass, sizeof(__pyx_k_surrogatepass), 0, 1, 0, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_b_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 0, 1},
  {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_to_bytes, __pyx_k_to_bytes, sizeof(__pyx_k_to_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_b_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 0, 1},
  {&__pyx_kp_u_u000a, __pyx_k_u000a, sizeof(__pyx_k_u000a), 0, 1, 0, 0},
  {&__pyx_kp_u_u005c, __pyx_k_u005c, sizeof(__pyx_k_u005c), 0, 1, 0, 0},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_kp_u_use_protocols_4_to_enable_suppor, __pyx_k_use_protocols_4_to_enable_suppor, sizeof(__pyx_k_use_protocols_4_to_enable_suppor), 0, 1, 0, 0},
  {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "cycloudpickle/cypickle.pyx":176
 *             f = self.current_frame
 *             if f.tell() >= self._FRAME_SIZE_TARGET or force:
 *                 with f.getbuffer() as data:             # <<<<<<<<<<<<<<
 *                     n = len(data)
 *                     write = self.file_write
 */
  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "cycloudpickle/cypickle.pyx":182
 *                     write(pack("<Q", n))
 *                     write(data)
 *                 f.seek(0)             # <<<<<<<<<<<<<<
 *                 f.truncate()
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "cycloudpickle/cypickle.pyx":295
 *             self._file_write = file.write
 *         except AttributeError:
 *             raise TypeError("file must have a 'write' attribute")             # <<<<<<<<<<<<<<
 *         self.framer = _Framer(self._file_write)
 *         self.write = self.framer.write
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_file_must_have_a_write_attribute); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "cycloudpickle/cypickle.pyx":356
 *                 return LONG_BINPUT + pack("<I", idx)
 *         else:
 *             return PUT + repr(idx).encode("ascii") + b'\n'             # <<<<<<<<<<<<<<
 * 
 *     # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "cycloudpickle/cypickle.pyx":366
 *                 return LONG_BINGET + pack("<I", i)
 * 
 *         return GET + repr(i).encode("ascii") + b'\n'             # <<<<<<<<<<<<<<
 * 
 *     def save(self, object obj, bint save_persistent_id=True):
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "cycloudpickle/cypickle.pyx":451
 * 
 *         if not isinstance(args, tuple):
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")             # <<<<<<<<<<<<<<
 *         if not callable(func):
 *             raise pickle.PicklingError("func from save_reduce() must be callable")
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_args_from_save_reduce_must_be_a); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "cycloudpickle/cypickle.pyx":453
 *             raise pickle.PicklingError("args from save_reduce() must be a tuple")
 *         if not callable(func):
 *             raise pickle.PicklingError("func from save_reduce() must be callable")             # <<<<<<<<<<<<<<
 * 
 *         save = self.save
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_func_from_save_reduce_must_be_ca); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "cycloudpickle/cypickle.pyx":500
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_args_0_from___newobj___args_has); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "cycloudpickle/cypickle.pyx":503
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_args_0_from___newobj___args_has_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "cycloudpickle/cypickle.pyx":505
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]             # <<<<<<<<<<<<<<
 *             save(cls)
 *             save(args)
 */
  __pyx_slice__13 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__13);
  __Pyx_GIVEREF(__pyx_slice__13);

  /* "cycloudpickle/cypickle.pyx":578
 *                 self.write(LONG4 + pack("<i", n) + encoded)
 *             return
 *         self.write(LONG + repr(obj).encode("ascii") + b'L\n')             # <<<<<<<<<<<<<<
 *     dispatch[int] = save_long
 * 
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "cycloudpickle/cypickle.pyx":585
 *             self.write(BINFLOAT + pack('>d', obj))
 *         else:
 *             self.write(FLOAT + repr(obj).encode("ascii") + b'\n')             # <<<<<<<<<<<<<<
 *     dispatch[float] = save_float
 * 
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "cycloudpickle/cypickle.pyx":608
 *     def save_str(self, obj):
 *         if self.bin:
 *             encoded = obj.encode('utf-8', 'surrogatepass')             # <<<<<<<<<<<<<<
 *             n = len(encoded)
 *             if n <= 0xff and self.proto >= 4:
 */
  __pyx_tuple__16 = PyTuple_Pack(2, __pyx_kp_u_utf_8, __pyx_n_u_surrogatepass); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "cycloudpickle/cypickle.pyx":617
 *                 self.write(BINUNICODE + pack("<I", n) + encoded)
 *         else:
 *             obj = obj.replace("\\", "\\u005c")             # <<<<<<<<<<<<<<
 *             obj = obj.replace("\n", "\\u000a")
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +
 */
  __pyx_tuple__18 = PyTuple_Pack(2, __pyx_kp_u__17, __pyx_kp_u_u005c); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "cycloudpickle/cypickle.pyx":618
 *         else:
 *             obj = obj.replace("\\", "\\u005c")
 *             obj = obj.replace("\n", "\\u000a")             # <<<<<<<<<<<<<<
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +
 *                        b'\n')
 */
  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_kp_u__7, __pyx_kp_u_u000a); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "cycloudpickle/cypickle.pyx":619
 *             obj = obj.replace("\\", "\\u005c")
 *             obj = obj.replace("\n", "\\u000a")
 *             self.write(UNICODE + obj.encode('raw-unicode-escape') +             # <<<<<<<<<<<<<<
 *                        b'\n')
 *         self.memoize(obj)
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_raw_unicode_escape); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "cycloudpickle/cypickle.pyx":868
 *     def save_type(self, obj):
 *         if obj is type(None):
 *             return self.save_reduce(type, (None,), obj=obj)             # <<<<<<<<<<<<<<
 *         elif obj is type(NotImplemented):
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "cycloudpickle/cypickle.pyx":872
 *             return self.save_reduce(type, (NotImplemented,), obj=obj)
 *         elif obj is type(...):
 *             return self.save_reduce(type, (...,), obj=obj)             # <<<<<<<<<<<<<<
 *         return self.save_global(obj)
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(1, Py_Ellipsis); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2147483647 = PyInt_FromLong(2147483647L); if (unlikely(!__pyx_int_2147483647)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_neg_2147483648 = PyInt_FromLong(-2147483648L); if (unlikely(!__pyx_int_neg_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcypickle(void); /*proto*/
PyMODINIT_FUNC initcypickle(void)
#else
PyMODINIT_FUNC PyInit_cypickle(void); /*proto*/
PyMODINIT_FUNC PyInit_cypickle(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cypickle(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("cypickle", __pyx_methods, __pyx_k_This_file_is_an_adaptation_of_p, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_cycloudpickle__cypickle) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "cycloudpickle.cypickle")) {
      if (unlikely(PyDict_SetItemString(modules, "cycloudpickle.cypickle", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_13cycloudpickle_8cypickle_bytes_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_format_version = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_compatible_formats = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_MARK = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_STOP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_POP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_POP_MARK = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_DUP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_FLOAT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_INT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BININT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BININT1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_LONG = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BININT2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_NONE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_PERSID = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINPERSID = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_REDUCE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_STRING = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINSTRING = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_SHORT_BINSTRING = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_UNICODE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINUNICODE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_APPEND = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BUILD = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_GLOBAL = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_DICT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_APPENDS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_GET = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINGET = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_INST = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_LONG_BINGET = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_LIST = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_OBJ = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_PUT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINPUT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_LONG_BINPUT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_SETITEM = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_TUPLE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_SETITEMS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINFLOAT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_TRUE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_FALSE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_PROTO = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_NEWOBJ = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EXT1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EXT2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EXT4 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_TUPLE1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_TUPLE2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_TUPLE3 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_NEWTRUE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_NEWFALSE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_LONG1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_LONG4 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle__tuplesize2code = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINBYTES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_SHORT_BINBYTES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_SHORT_BINUNICODE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINUNICODE8 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_BINBYTES8 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_EMPTY_SET = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_ADDITEMS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_FROZENSET = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_MEMOIZE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_13cycloudpickle_8cypickle_FRAME = ((PyObject*)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_13cycloudpickle_8cypickle__Framer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_13cycloudpickle_8cypickle__Framer.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_Framer", (PyObject *)&__pyx_type_13cycloudpickle_8cypickle__Framer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_13cycloudpickle_8cypickle__Framer = &__pyx_type_13cycloudpickle_8cypickle__Framer;
  if (PyType_Ready(&__pyx_type_13cycloudpickle_8cypickle_Pickler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_13cycloudpickle_8cypickle_Pickler.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_13cycloudpickle_8cypickle_Pickler, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_13cycloudpickle_8cypickle_7Pickler___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_13cycloudpickle_8cypickle_7Pickler___init__.doc = __pyx_doc_13cycloudpickle_8cypickle_7Pickler___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_13cycloudpickle_8cypickle_7Pickler___init__;
    }
  }
  #endif
  if (PyObject_SetAttrString(__pyx_m, "Pickler", (PyObject *)&__pyx_type_13cycloudpickle_8cypickle_Pickler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_13cycloudpickle_8cypickle_Pickler = &__pyx_type_13cycloudpickle_8cypickle_Pickler;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "cycloudpickle/cypickle.pyx":31
 * """
 * 
 * from copyreg import _extension_registry, _inverted_registry, _extension_cache             # <<<<<<<<<<<<<<
 * from copyreg import dispatch_table
 * from itertools import islice
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_extension_registry);
  __Pyx_GIVEREF(__pyx_n_s_extension_registry);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_extension_registry);
  __Pyx_INCREF(__pyx_n_s_inverted_registry);
  __Pyx_GIVEREF(__pyx_n_s_inverted_registry);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_inverted_registry);
  __Pyx_INCREF(__pyx_n_s_extension_cache);
  __Pyx_GIVEREF(__pyx_n_s_extension_cache);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_extension_cache);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_copyreg, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_extension_registry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extension_registry, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_inverted_registry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inverted_registry, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_extension_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extension_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":32
 * 
 * from copyreg import _extension_registry, _inverted_registry, _extension_cache
 * from copyreg import dispatch_table             # <<<<<<<<<<<<<<
 * from itertools import islice
 * from struct import pack, unpack
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_dispatch_table);
  __Pyx_GIVEREF(__pyx_n_s_dispatch_table);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dispatch_table);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_copyreg, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_dispatch_table); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dispatch_table, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":33
 * from copyreg import _extension_registry, _inverted_registry, _extension_cache
 * from copyreg import dispatch_table
 * from itertools import islice             # <<<<<<<<<<<<<<
 * from struct import pack, unpack
 * from sys import maxsize
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_islice);
  __Pyx_GIVEREF(__pyx_n_s_islice);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_islice);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_islice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_islice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":34
 * from copyreg import dispatch_table
 * from itertools import islice
 * from struct import pack, unpack             # <<<<<<<<<<<<<<
 * from sys import maxsize
 * from types import FunctionType
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_pack);
  __Pyx_GIVEREF(__pyx_n_s_pack);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_pack);
  __Pyx_INCREF(__pyx_n_s_unpack);
  __Pyx_GIVEREF(__pyx_n_s_unpack);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_unpack);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_pack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pack, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unpack); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":35
 * from itertools import islice
 * from struct import pack, unpack
 * from sys import maxsize             # <<<<<<<<<<<<<<
 * from types import FunctionType
 * import _compat_pickle
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_maxsize);
  __Pyx_GIVEREF(__pyx_n_s_maxsize);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_maxsize);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_maxsize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cypickle.pyx":36
 * from struct import pack, unpack
 * from sys import maxsize
 * from types import FunctionType             # <<<<<<<<<<<<<<
 * import _compat_pickle
 * import codecs
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_FunctionType);
  __Pyx_GIVEREF(__pyx_n_s_FunctionType);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FunctionType);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionType, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":37
 * from sys import maxsize
 * from types import FunctionType
 * import _compat_pickle             # <<<<<<<<<<<<<<
 * import codecs
 * import io
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_compat_pickle, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat_pickle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":38
 * from types import FunctionType
 * import _compat_pickle
 * import codecs             # <<<<<<<<<<<<<<
 * import io
 * import pickle
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_codecs, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":39
 * import _compat_pickle
 * import codecs
 * import io             # <<<<<<<<<<<<<<
 * import pickle
 * import re
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_io, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":40
 * import codecs
 * import io
 * import pickle             # <<<<<<<<<<<<<<
 * import re
 * import sys
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":41
 * import io
 * import pickle
 * import re             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":42
 * import pickle
 * import re
 * import sys             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":45
 * 
 * 
 * __all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",             # <<<<<<<<<<<<<<
 *            "Unpickler", "dump", "dumps", "load", "loads"]
 * 
 */
  __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_u_PickleError);
  __Pyx_GIVEREF(__pyx_n_u_PickleError);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_PickleError);
  __Pyx_INCREF(__pyx_n_u_PicklingError);
  __Pyx_GIVEREF(__pyx_n_u_PicklingError);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_PicklingError);
  __Pyx_INCREF(__pyx_n_u_UnpicklingError);
  __Pyx_GIVEREF(__pyx_n_u_UnpicklingError);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_UnpicklingError);
  __Pyx_INCREF(__pyx_n_u_Pickler);
  __Pyx_GIVEREF(__pyx_n_u_Pickler);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_Pickler);
  __Pyx_INCREF(__pyx_n_u_Unpickler);
  __Pyx_GIVEREF(__pyx_n_u_Unpickler);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_Unpickler);
  __Pyx_INCREF(__pyx_n_u_dump);
  __Pyx_GIVEREF(__pyx_n_u_dump);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_dump);
  __Pyx_INCREF(__pyx_n_u_dumps);
  __Pyx_GIVEREF(__pyx_n_u_dumps);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_dumps);
  __Pyx_INCREF(__pyx_n_u_load);
  __Pyx_GIVEREF(__pyx_n_u_load);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_load);
  __Pyx_INCREF(__pyx_n_u_loads);
  __Pyx_GIVEREF(__pyx_n_u_loads);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_u_loads);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":49
 * 
 * # Shortcut for use in isinstance testing
 * cdef tuple bytes_types = (bytes, bytearray)             # <<<<<<<<<<<<<<
 * 
 * # These are purely informational; no code uses these.
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyBytes_Type)));
  __Pyx_INCREF(((PyObject *)(&PyByteArray_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyByteArray_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyByteArray_Type)));
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_bytes_types);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_bytes_types, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":52
 * 
 * # These are purely informational; no code uses these.
 * cdef str format_version = "4.0"  # File format version we write             # <<<<<<<<<<<<<<
 * cdef list compatible_formats = ["1.0",  # Original protocol 0
 *                                 "1.1",  # Protocol 0 with INST added
 */
  __Pyx_INCREF(__pyx_kp_u_4_0);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_format_version);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_format_version, __pyx_kp_u_4_0);
  __Pyx_GIVEREF(__pyx_kp_u_4_0);

  /* "cycloudpickle/cypickle.pyx":53
 * # These are purely informational; no code uses these.
 * cdef str format_version = "4.0"  # File format version we write
 * cdef list compatible_formats = ["1.0",  # Original protocol 0             # <<<<<<<<<<<<<<
 *                                 "1.1",  # Protocol 0 with INST added
 *                                 "1.2",  # Original protocol 1
 */
  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_u_1_0);
  __Pyx_GIVEREF(__pyx_kp_u_1_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_1_0);
  __Pyx_INCREF(__pyx_kp_u_1_1);
  __Pyx_GIVEREF(__pyx_kp_u_1_1);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_1_1);
  __Pyx_INCREF(__pyx_kp_u_1_2);
  __Pyx_GIVEREF(__pyx_kp_u_1_2);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_1_2);
  __Pyx_INCREF(__pyx_kp_u_1_3);
  __Pyx_GIVEREF(__pyx_kp_u_1_3);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_1_3);
  __Pyx_INCREF(__pyx_kp_u_2_0);
  __Pyx_GIVEREF(__pyx_kp_u_2_0);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_2_0);
  __Pyx_INCREF(__pyx_kp_u_3_0);
  __Pyx_GIVEREF(__pyx_kp_u_3_0);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_3_0);
  __Pyx_INCREF(__pyx_kp_u_4_0);
  __Pyx_GIVEREF(__pyx_kp_u_4_0);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_4_0);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_compatible_formats);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_compatible_formats, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":63
 * 
 * # This is the highest protocol number we know how to read.
 * cdef int HIGHEST_PROTOCOL = 4             # <<<<<<<<<<<<<<
 * 
 * # The protocol we write by default.  May be less than HIGHEST_PROTOCOL.
 */
  __pyx_v_13cycloudpickle_8cypickle_HIGHEST_PROTOCOL = 4;

  /* "cycloudpickle/cypickle.pyx":68
 * # We intentionally write a protocol that Python 2.x cannot read;
 * # there are too many issues with that.
 * cdef int DEFAULT_PROTOCOL = 3             # <<<<<<<<<<<<<<
 * 
 * # Pickle opcodes.  See pickletools.py for extensive docs.  The listing
 */
  __pyx_v_13cycloudpickle_8cypickle_DEFAULT_PROTOCOL = 3;

  /* "cycloudpickle/cypickle.pyx":74
 * # pickletools groups them by purpose.
 * 
 * cdef bytes MARK = b'('  # push special markobject on stack             # <<<<<<<<<<<<<<
 * cdef bytes STOP = b'.'  # every pickle ends with STOP
 * cdef bytes POP = b'0'  # discard topmost stack item
 */
  __Pyx_INCREF(__pyx_kp_b__23);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_MARK);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_MARK, __pyx_kp_b__23);
  __Pyx_GIVEREF(__pyx_kp_b__23);

  /* "cycloudpickle/cypickle.pyx":75
 * 
 * cdef bytes MARK = b'('  # push special markobject on stack
 * cdef bytes STOP = b'.'  # every pickle ends with STOP             # <<<<<<<<<<<<<<
 * cdef bytes POP = b'0'  # discard topmost stack item
 * cdef bytes POP_MARK = b'1'  # discard stack top through topmost markobject
 */
  __Pyx_INCREF(__pyx_kp_b__3);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_STOP);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_STOP, __pyx_kp_b__3);
  __Pyx_GIVEREF(__pyx_kp_b__3);

  /* "cycloudpickle/cypickle.pyx":76
 * cdef bytes MARK = b'('  # push special markobject on stack
 * cdef bytes STOP = b'.'  # every pickle ends with STOP
 * cdef bytes POP = b'0'  # discard topmost stack item             # <<<<<<<<<<<<<<
 * cdef bytes POP_MARK = b'1'  # discard stack top through topmost markobject
 * cdef bytes DUP = b'2'  # duplicate top stack item
 */
  __Pyx_INCREF(__pyx_kp_b_0);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_POP);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_POP, __pyx_kp_b_0);
  __Pyx_GIVEREF(__pyx_kp_b_0);

  /* "cycloudpickle/cypickle.pyx":77
 * cdef bytes STOP = b'.'  # every pickle ends with STOP
 * cdef bytes POP = b'0'  # discard topmost stack item
 * cdef bytes POP_MARK = b'1'  # discard stack top through topmost markobject             # <<<<<<<<<<<<<<
 * cdef bytes DUP = b'2'  # duplicate top stack item
 * cdef bytes FLOAT = b'F'  # push float object; decimal string argument
 */
  __Pyx_INCREF(__pyx_kp_b_1);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_POP_MARK);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_POP_MARK, __pyx_kp_b_1);
  __Pyx_GIVEREF(__pyx_kp_b_1);

  /* "cycloudpickle/cypickle.pyx":78
 * cdef bytes POP = b'0'  # discard topmost stack item
 * cdef bytes POP_MARK = b'1'  # discard stack top through topmost markobject
 * cdef bytes DUP = b'2'  # duplicate top stack item             # <<<<<<<<<<<<<<
 * cdef bytes FLOAT = b'F'  # push float object; decimal string argument
 * cdef bytes INT = b'I'  # push integer or bool; decimal string argument
 */
  __Pyx_INCREF(__pyx_kp_b_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_DUP);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_DUP, __pyx_kp_b_2);
  __Pyx_GIVEREF(__pyx_kp_b_2);

  /* "cycloudpickle/cypickle.pyx":79
 * cdef bytes POP_MARK = b'1'  # discard stack top through topmost markobject
 * cdef bytes DUP = b'2'  # duplicate top stack item
 * cdef bytes FLOAT = b'F'  # push float object; decimal string argument             # <<<<<<<<<<<<<<
 * cdef bytes INT = b'I'  # push integer or bool; decimal string argument
 * cdef bytes BININT = b'J'  # push four-byte signed int
 */
  __Pyx_INCREF(__pyx_n_b_F);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_FLOAT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_FLOAT, __pyx_n_b_F);
  __Pyx_GIVEREF(__pyx_n_b_F);

  /* "cycloudpickle/cypickle.pyx":80
 * cdef bytes DUP = b'2'  # duplicate top stack item
 * cdef bytes FLOAT = b'F'  # push float object; decimal string argument
 * cdef bytes INT = b'I'  # push integer or bool; decimal string argument             # <<<<<<<<<<<<<<
 * cdef bytes BININT = b'J'  # push four-byte signed int
 * cdef bytes BININT1 = b'K'  # push 1-byte unsigned int
 */
  __Pyx_INCREF(__pyx_n_b_I_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_INT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_INT, __pyx_n_b_I_2);
  __Pyx_GIVEREF(__pyx_n_b_I_2);

  /* "cycloudpickle/cypickle.pyx":81
 * cdef bytes FLOAT = b'F'  # push float object; decimal string argument
 * cdef bytes INT = b'I'  # push integer or bool; decimal string argument
 * cdef bytes BININT = b'J'  # push four-byte signed int             # <<<<<<<<<<<<<<
 * cdef bytes BININT1 = b'K'  # push 1-byte unsigned int
 * cdef bytes LONG = b'L'  # push long; decimal string argument
 */
  __Pyx_INCREF(__pyx_n_b_J);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BININT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BININT, __pyx_n_b_J);
  __Pyx_GIVEREF(__pyx_n_b_J);

  /* "cycloudpickle/cypickle.pyx":82
 * cdef bytes INT = b'I'  # push integer or bool; decimal string argument
 * cdef bytes BININT = b'J'  # push four-byte signed int
 * cdef bytes BININT1 = b'K'  # push 1-byte unsigned int             # <<<<<<<<<<<<<<
 * cdef bytes LONG = b'L'  # push long; decimal string argument
 * cdef bytes BININT2 = b'M'  # push 2-byte unsigned int
 */
  __Pyx_INCREF(__pyx_n_b_K);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BININT1);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BININT1, __pyx_n_b_K);
  __Pyx_GIVEREF(__pyx_n_b_K);

  /* "cycloudpickle/cypickle.pyx":83
 * cdef bytes BININT = b'J'  # push four-byte signed int
 * cdef bytes BININT1 = b'K'  # push 1-byte unsigned int
 * cdef bytes LONG = b'L'  # push long; decimal string argument             # <<<<<<<<<<<<<<
 * cdef bytes BININT2 = b'M'  # push 2-byte unsigned int
 * cdef bytes NONE = b'N'  # push None
 */
  __Pyx_INCREF(__pyx_n_b_L_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_LONG);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_LONG, __pyx_n_b_L_2);
  __Pyx_GIVEREF(__pyx_n_b_L_2);

  /* "cycloudpickle/cypickle.pyx":84
 * cdef bytes BININT1 = b'K'  # push 1-byte unsigned int
 * cdef bytes LONG = b'L'  # push long; decimal string argument
 * cdef bytes BININT2 = b'M'  # push 2-byte unsigned int             # <<<<<<<<<<<<<<
 * cdef bytes NONE = b'N'  # push None
 * cdef bytes PERSID = b'P'  # push persistent object; id is taken from string arg
 */
  __Pyx_INCREF(__pyx_n_b_M);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BININT2);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BININT2, __pyx_n_b_M);
  __Pyx_GIVEREF(__pyx_n_b_M);

  /* "cycloudpickle/cypickle.pyx":85
 * cdef bytes LONG = b'L'  # push long; decimal string argument
 * cdef bytes BININT2 = b'M'  # push 2-byte unsigned int
 * cdef bytes NONE = b'N'  # push None             # <<<<<<<<<<<<<<
 * cdef bytes PERSID = b'P'  # push persistent object; id is taken from string arg
 * cdef bytes BINPERSID = b'Q'  #  "       "         "  ;  "  "   "     "  stack
 */
  __Pyx_INCREF(__pyx_n_b_N);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_NONE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_NONE, __pyx_n_b_N);
  __Pyx_GIVEREF(__pyx_n_b_N);

  /* "cycloudpickle/cypickle.pyx":86
 * cdef bytes BININT2 = b'M'  # push 2-byte unsigned int
 * cdef bytes NONE = b'N'  # push None
 * cdef bytes PERSID = b'P'  # push persistent object; id is taken from string arg             # <<<<<<<<<<<<<<
 * cdef bytes BINPERSID = b'Q'  #  "       "         "  ;  "  "   "     "  stack
 * cdef bytes REDUCE = b'R'  # apply callable to argtuple, both on stack
 */
  __Pyx_INCREF(__pyx_n_b_P);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_PERSID);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_PERSID, __pyx_n_b_P);
  __Pyx_GIVEREF(__pyx_n_b_P);

  /* "cycloudpickle/cypickle.pyx":87
 * cdef bytes NONE = b'N'  # push None
 * cdef bytes PERSID = b'P'  # push persistent object; id is taken from string arg
 * cdef bytes BINPERSID = b'Q'  #  "       "         "  ;  "  "   "     "  stack             # <<<<<<<<<<<<<<
 * cdef bytes REDUCE = b'R'  # apply callable to argtuple, both on stack
 * cdef bytes STRING = b'S'  # push string; NL-terminated string argument
 */
  __Pyx_INCREF(__pyx_n_b_Q_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINPERSID);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINPERSID, __pyx_n_b_Q_2);
  __Pyx_GIVEREF(__pyx_n_b_Q_2);

  /* "cycloudpickle/cypickle.pyx":88
 * cdef bytes PERSID = b'P'  # push persistent object; id is taken from string arg
 * cdef bytes BINPERSID = b'Q'  #  "       "         "  ;  "  "   "     "  stack
 * cdef bytes REDUCE = b'R'  # apply callable to argtuple, both on stack             # <<<<<<<<<<<<<<
 * cdef bytes STRING = b'S'  # push string; NL-terminated string argument
 * cdef bytes BINSTRING = b'T'  # push string; counted binary string argument
 */
  __Pyx_INCREF(__pyx_n_b_R);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_REDUCE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_REDUCE, __pyx_n_b_R);
  __Pyx_GIVEREF(__pyx_n_b_R);

  /* "cycloudpickle/cypickle.pyx":89
 * cdef bytes BINPERSID = b'Q'  #  "       "         "  ;  "  "   "     "  stack
 * cdef bytes REDUCE = b'R'  # apply callable to argtuple, both on stack
 * cdef bytes STRING = b'S'  # push string; NL-terminated string argument             # <<<<<<<<<<<<<<
 * cdef bytes BINSTRING = b'T'  # push string; counted binary string argument
 * cdef bytes SHORT_BINSTRING = b'U'  #  "     "   ;    "      "       "      " < 256 bytes
 */
  __Pyx_INCREF(__pyx_n_b_S);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_STRING);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_STRING, __pyx_n_b_S);
  __Pyx_GIVEREF(__pyx_n_b_S);

  /* "cycloudpickle/cypickle.pyx":90
 * cdef bytes REDUCE = b'R'  # apply callable to argtuple, both on stack
 * cdef bytes STRING = b'S'  # push string; NL-terminated string argument
 * cdef bytes BINSTRING = b'T'  # push string; counted binary string argument             # <<<<<<<<<<<<<<
 * cdef bytes SHORT_BINSTRING = b'U'  #  "     "   ;    "      "       "      " < 256 bytes
 * cdef bytes UNICODE = b'V'  # push Unicode string; raw-unicode-escaped'd argument
 */
  __Pyx_INCREF(__pyx_n_b_T);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINSTRING);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINSTRING, __pyx_n_b_T);
  __Pyx_GIVEREF(__pyx_n_b_T);

  /* "cycloudpickle/cypickle.pyx":91
 * cdef bytes STRING = b'S'  # push string; NL-terminated string argument
 * cdef bytes BINSTRING = b'T'  # push string; counted binary string argument
 * cdef bytes SHORT_BINSTRING = b'U'  #  "     "   ;    "      "       "      " < 256 bytes             # <<<<<<<<<<<<<<
 * cdef bytes UNICODE = b'V'  # push Unicode string; raw-unicode-escaped'd argument
 * cdef bytes BINUNICODE = b'X'  #   "     "       "  ; counted UTF-8 string argument
 */
  __Pyx_INCREF(__pyx_n_b_U);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINSTRING);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINSTRING, __pyx_n_b_U);
  __Pyx_GIVEREF(__pyx_n_b_U);

  /* "cycloudpickle/cypickle.pyx":92
 * cdef bytes BINSTRING = b'T'  # push string; counted binary string argument
 * cdef bytes SHORT_BINSTRING = b'U'  #  "     "   ;    "      "       "      " < 256 bytes
 * cdef bytes UNICODE = b'V'  # push Unicode string; raw-unicode-escaped'd argument             # <<<<<<<<<<<<<<
 * cdef bytes BINUNICODE = b'X'  #   "     "       "  ; counted UTF-8 string argument
 * cdef bytes APPEND = b'a'  # append stack top to list below it
 */
  __Pyx_INCREF(__pyx_n_b_V);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_UNICODE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_UNICODE, __pyx_n_b_V);
  __Pyx_GIVEREF(__pyx_n_b_V);

  /* "cycloudpickle/cypickle.pyx":93
 * cdef bytes SHORT_BINSTRING = b'U'  #  "     "   ;    "      "       "      " < 256 bytes
 * cdef bytes UNICODE = b'V'  # push Unicode string; raw-unicode-escaped'd argument
 * cdef bytes BINUNICODE = b'X'  #   "     "       "  ; counted UTF-8 string argument             # <<<<<<<<<<<<<<
 * cdef bytes APPEND = b'a'  # append stack top to list below it
 * cdef bytes BUILD = b'b'  # call __setstate__ or __dict__.update()
 */
  __Pyx_INCREF(__pyx_n_b_X);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINUNICODE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINUNICODE, __pyx_n_b_X);
  __Pyx_GIVEREF(__pyx_n_b_X);

  /* "cycloudpickle/cypickle.pyx":94
 * cdef bytes UNICODE = b'V'  # push Unicode string; raw-unicode-escaped'd argument
 * cdef bytes BINUNICODE = b'X'  #   "     "       "  ; counted UTF-8 string argument
 * cdef bytes APPEND = b'a'  # append stack top to list below it             # <<<<<<<<<<<<<<
 * cdef bytes BUILD = b'b'  # call __setstate__ or __dict__.update()
 * cdef bytes GLOBAL = b'c'  # push self.find_class(modname, name); 2 string args
 */
  __Pyx_INCREF(__pyx_n_b_a);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_APPEND);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_APPEND, __pyx_n_b_a);
  __Pyx_GIVEREF(__pyx_n_b_a);

  /* "cycloudpickle/cypickle.pyx":95
 * cdef bytes BINUNICODE = b'X'  #   "     "       "  ; counted UTF-8 string argument
 * cdef bytes APPEND = b'a'  # append stack top to list below it
 * cdef bytes BUILD = b'b'  # call __setstate__ or __dict__.update()             # <<<<<<<<<<<<<<
 * cdef bytes GLOBAL = b'c'  # push self.find_class(modname, name); 2 string args
 * cdef bytes DICT = b'd'  # build a dict from stack items
 */
  __Pyx_INCREF(__pyx_n_b_b);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BUILD);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BUILD, __pyx_n_b_b);
  __Pyx_GIVEREF(__pyx_n_b_b);

  /* "cycloudpickle/cypickle.pyx":96
 * cdef bytes APPEND = b'a'  # append stack top to list below it
 * cdef bytes BUILD = b'b'  # call __setstate__ or __dict__.update()
 * cdef bytes GLOBAL = b'c'  # push self.find_class(modname, name); 2 string args             # <<<<<<<<<<<<<<
 * cdef bytes DICT = b'd'  # build a dict from stack items
 * cdef bytes EMPTY_DICT = b'}'  # push empty dict
 */
  __Pyx_INCREF(__pyx_n_b_c);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_GLOBAL);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_GLOBAL, __pyx_n_b_c);
  __Pyx_GIVEREF(__pyx_n_b_c);

  /* "cycloudpickle/cypickle.pyx":97
 * cdef bytes BUILD = b'b'  # call __setstate__ or __dict__.update()
 * cdef bytes GLOBAL = b'c'  # push self.find_class(modname, name); 2 string args
 * cdef bytes DICT = b'd'  # build a dict from stack items             # <<<<<<<<<<<<<<
 * cdef bytes EMPTY_DICT = b'}'  # push empty dict
 * cdef bytes APPENDS = b'e'  # extend list on stack by topmost stack slice
 */
  __Pyx_INCREF(__pyx_n_b_d_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_DICT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_DICT, __pyx_n_b_d_2);
  __Pyx_GIVEREF(__pyx_n_b_d_2);

  /* "cycloudpickle/cypickle.pyx":98
 * cdef bytes GLOBAL = b'c'  # push self.find_class(modname, name); 2 string args
 * cdef bytes DICT = b'd'  # build a dict from stack items
 * cdef bytes EMPTY_DICT = b'}'  # push empty dict             # <<<<<<<<<<<<<<
 * cdef bytes APPENDS = b'e'  # extend list on stack by topmost stack slice
 * cdef bytes GET = b'g'  # push item from memo on stack; index is string arg
 */
  __Pyx_INCREF(__pyx_kp_b__24);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EMPTY_DICT, __pyx_kp_b__24);
  __Pyx_GIVEREF(__pyx_kp_b__24);

  /* "cycloudpickle/cypickle.pyx":99
 * cdef bytes DICT = b'd'  # build a dict from stack items
 * cdef bytes EMPTY_DICT = b'}'  # push empty dict
 * cdef bytes APPENDS = b'e'  # extend list on stack by topmost stack slice             # <<<<<<<<<<<<<<
 * cdef bytes GET = b'g'  # push item from memo on stack; index is string arg
 * cdef bytes BINGET = b'h'  #   "    "    "    "   "   "  ;   "    " 1-byte arg
 */
  __Pyx_INCREF(__pyx_n_b_e);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_APPENDS);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_APPENDS, __pyx_n_b_e);
  __Pyx_GIVEREF(__pyx_n_b_e);

  /* "cycloudpickle/cypickle.pyx":100
 * cdef bytes EMPTY_DICT = b'}'  # push empty dict
 * cdef bytes APPENDS = b'e'  # extend list on stack by topmost stack slice
 * cdef bytes GET = b'g'  # push item from memo on stack; index is string arg             # <<<<<<<<<<<<<<
 * cdef bytes BINGET = b'h'  #   "    "    "    "   "   "  ;   "    " 1-byte arg
 * cdef bytes INST = b'i'  # build & push class instance
 */
  __Pyx_INCREF(__pyx_n_b_g);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_GET);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_GET, __pyx_n_b_g);
  __Pyx_GIVEREF(__pyx_n_b_g);

  /* "cycloudpickle/cypickle.pyx":101
 * cdef bytes APPENDS = b'e'  # extend list on stack by topmost stack slice
 * cdef bytes GET = b'g'  # push item from memo on stack; index is string arg
 * cdef bytes BINGET = b'h'  #   "    "    "    "   "   "  ;   "    " 1-byte arg             # <<<<<<<<<<<<<<
 * cdef bytes INST = b'i'  # build & push class instance
 * cdef bytes LONG_BINGET = b'j'  # push item from memo on stack; index is 4-byte arg
 */
  __Pyx_INCREF(__pyx_n_b_h);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINGET);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINGET, __pyx_n_b_h);
  __Pyx_GIVEREF(__pyx_n_b_h);

  /* "cycloudpickle/cypickle.pyx":102
 * cdef bytes GET = b'g'  # push item from memo on stack; index is string arg
 * cdef bytes BINGET = b'h'  #   "    "    "    "   "   "  ;   "    " 1-byte arg
 * cdef bytes INST = b'i'  # build & push class instance             # <<<<<<<<<<<<<<
 * cdef bytes LONG_BINGET = b'j'  # push item from memo on stack; index is 4-byte arg
 * cdef bytes LIST = b'l'  # build list from topmost stack items
 */
  __Pyx_INCREF(__pyx_n_b_i_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_INST);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_INST, __pyx_n_b_i_2);
  __Pyx_GIVEREF(__pyx_n_b_i_2);

  /* "cycloudpickle/cypickle.pyx":103
 * cdef bytes BINGET = b'h'  #   "    "    "    "   "   "  ;   "    " 1-byte arg
 * cdef bytes INST = b'i'  # build & push class instance
 * cdef bytes LONG_BINGET = b'j'  # push item from memo on stack; index is 4-byte arg             # <<<<<<<<<<<<<<
 * cdef bytes LIST = b'l'  # build list from topmost stack items
 * cdef bytes EMPTY_LIST = b']'  # push empty list
 */
  __Pyx_INCREF(__pyx_n_b_j);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_LONG_BINGET);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_LONG_BINGET, __pyx_n_b_j);
  __Pyx_GIVEREF(__pyx_n_b_j);

  /* "cycloudpickle/cypickle.pyx":104
 * cdef bytes INST = b'i'  # build & push class instance
 * cdef bytes LONG_BINGET = b'j'  # push item from memo on stack; index is 4-byte arg
 * cdef bytes LIST = b'l'  # build list from topmost stack items             # <<<<<<<<<<<<<<
 * cdef bytes EMPTY_LIST = b']'  # push empty list
 * cdef bytes OBJ = b'o'  # build & push class instance
 */
  __Pyx_INCREF(__pyx_n_b_l);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_LIST);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_LIST, __pyx_n_b_l);
  __Pyx_GIVEREF(__pyx_n_b_l);

  /* "cycloudpickle/cypickle.pyx":105
 * cdef bytes LONG_BINGET = b'j'  # push item from memo on stack; index is 4-byte arg
 * cdef bytes LIST = b'l'  # build list from topmost stack items
 * cdef bytes EMPTY_LIST = b']'  # push empty list             # <<<<<<<<<<<<<<
 * cdef bytes OBJ = b'o'  # build & push class instance
 * cdef bytes PUT = b'p'  # store stack top in memo; index is string arg
 */
  __Pyx_INCREF(__pyx_kp_b__25);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EMPTY_LIST, __pyx_kp_b__25);
  __Pyx_GIVEREF(__pyx_kp_b__25);

  /* "cycloudpickle/cypickle.pyx":106
 * cdef bytes LIST = b'l'  # build list from topmost stack items
 * cdef bytes EMPTY_LIST = b']'  # push empty list
 * cdef bytes OBJ = b'o'  # build & push class instance             # <<<<<<<<<<<<<<
 * cdef bytes PUT = b'p'  # store stack top in memo; index is string arg
 * cdef bytes BINPUT = b'q'  #   "     "    "   "   " ;   "    " 1-byte arg
 */
  __Pyx_INCREF(__pyx_n_b_o);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_OBJ);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_OBJ, __pyx_n_b_o);
  __Pyx_GIVEREF(__pyx_n_b_o);

  /* "cycloudpickle/cypickle.pyx":107
 * cdef bytes EMPTY_LIST = b']'  # push empty list
 * cdef bytes OBJ = b'o'  # build & push class instance
 * cdef bytes PUT = b'p'  # store stack top in memo; index is string arg             # <<<<<<<<<<<<<<
 * cdef bytes BINPUT = b'q'  #   "     "    "   "   " ;   "    " 1-byte arg
 * cdef bytes LONG_BINPUT = b'r'  #   "     "    "   "   " ;   "    " 4-byte arg
 */
  __Pyx_INCREF(__pyx_n_b_p);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_PUT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_PUT, __pyx_n_b_p);
  __Pyx_GIVEREF(__pyx_n_b_p);

  /* "cycloudpickle/cypickle.pyx":108
 * cdef bytes OBJ = b'o'  # build & push class instance
 * cdef bytes PUT = b'p'  # store stack top in memo; index is string arg
 * cdef bytes BINPUT = b'q'  #   "     "    "   "   " ;   "    " 1-byte arg             # <<<<<<<<<<<<<<
 * cdef bytes LONG_BINPUT = b'r'  #   "     "    "   "   " ;   "    " 4-byte arg
 * cdef bytes SETITEM = b's'  # add key+value pair to dict
 */
  __Pyx_INCREF(__pyx_n_b_q);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINPUT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINPUT, __pyx_n_b_q);
  __Pyx_GIVEREF(__pyx_n_b_q);

  /* "cycloudpickle/cypickle.pyx":109
 * cdef bytes PUT = b'p'  # store stack top in memo; index is string arg
 * cdef bytes BINPUT = b'q'  #   "     "    "   "   " ;   "    " 1-byte arg
 * cdef bytes LONG_BINPUT = b'r'  #   "     "    "   "   " ;   "    " 4-byte arg             # <<<<<<<<<<<<<<
 * cdef bytes SETITEM = b's'  # add key+value pair to dict
 * cdef bytes TUPLE = b't'  # build tuple from topmost stack items
 */
  __Pyx_INCREF(__pyx_n_b_r);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_LONG_BINPUT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_LONG_BINPUT, __pyx_n_b_r);
  __Pyx_GIVEREF(__pyx_n_b_r);

  /* "cycloudpickle/cypickle.pyx":110
 * cdef bytes BINPUT = b'q'  #   "     "    "   "   " ;   "    " 1-byte arg
 * cdef bytes LONG_BINPUT = b'r'  #   "     "    "   "   " ;   "    " 4-byte arg
 * cdef bytes SETITEM = b's'  # add key+value pair to dict             # <<<<<<<<<<<<<<
 * cdef bytes TUPLE = b't'  # build tuple from topmost stack items
 * cdef bytes EMPTY_TUPLE = b')'  # push empty tuple
 */
  __Pyx_INCREF(__pyx_n_b_s);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_SETITEM);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_SETITEM, __pyx_n_b_s);
  __Pyx_GIVEREF(__pyx_n_b_s);

  /* "cycloudpickle/cypickle.pyx":111
 * cdef bytes LONG_BINPUT = b'r'  #   "     "    "   "   " ;   "    " 4-byte arg
 * cdef bytes SETITEM = b's'  # add key+value pair to dict
 * cdef bytes TUPLE = b't'  # build tuple from topmost stack items             # <<<<<<<<<<<<<<
 * cdef bytes EMPTY_TUPLE = b')'  # push empty tuple
 * cdef bytes SETITEMS = b'u'  # modify dict by adding topmost key+value pairs
 */
  __Pyx_INCREF(__pyx_n_b_t);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_TUPLE, __pyx_n_b_t);
  __Pyx_GIVEREF(__pyx_n_b_t);

  /* "cycloudpickle/cypickle.pyx":112
 * cdef bytes SETITEM = b's'  # add key+value pair to dict
 * cdef bytes TUPLE = b't'  # build tuple from topmost stack items
 * cdef bytes EMPTY_TUPLE = b')'  # push empty tuple             # <<<<<<<<<<<<<<
 * cdef bytes SETITEMS = b'u'  # modify dict by adding topmost key+value pairs
 * cdef bytes BINFLOAT = b'G'  # push float; arg is 8-byte float encoding
 */
  __Pyx_INCREF(__pyx_kp_b__26);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE, __pyx_kp_b__26);
  __Pyx_GIVEREF(__pyx_kp_b__26);

  /* "cycloudpickle/cypickle.pyx":113
 * cdef bytes TUPLE = b't'  # build tuple from topmost stack items
 * cdef bytes EMPTY_TUPLE = b')'  # push empty tuple
 * cdef bytes SETITEMS = b'u'  # modify dict by adding topmost key+value pairs             # <<<<<<<<<<<<<<
 * cdef bytes BINFLOAT = b'G'  # push float; arg is 8-byte float encoding
 * 
 */
  __Pyx_INCREF(__pyx_n_b_u);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_SETITEMS);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_SETITEMS, __pyx_n_b_u);
  __Pyx_GIVEREF(__pyx_n_b_u);

  /* "cycloudpickle/cypickle.pyx":114
 * cdef bytes EMPTY_TUPLE = b')'  # push empty tuple
 * cdef bytes SETITEMS = b'u'  # modify dict by adding topmost key+value pairs
 * cdef bytes BINFLOAT = b'G'  # push float; arg is 8-byte float encoding             # <<<<<<<<<<<<<<
 * 
 * cdef bytes TRUE = b'I01\n'  # not an opcode; see INT docs in pickletools.py
 */
  __Pyx_INCREF(__pyx_n_b_G);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINFLOAT);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINFLOAT, __pyx_n_b_G);
  __Pyx_GIVEREF(__pyx_n_b_G);

  /* "cycloudpickle/cypickle.pyx":116
 * cdef bytes BINFLOAT = b'G'  # push float; arg is 8-byte float encoding
 * 
 * cdef bytes TRUE = b'I01\n'  # not an opcode; see INT docs in pickletools.py             # <<<<<<<<<<<<<<
 * cdef bytes FALSE = b'I00\n'  # not an opcode; see INT docs in pickletools.py
 * 
 */
  __Pyx_INCREF(__pyx_n_b_I01);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_TRUE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_TRUE, __pyx_n_b_I01);
  __Pyx_GIVEREF(__pyx_n_b_I01);

  /* "cycloudpickle/cypickle.pyx":117
 * 
 * cdef bytes TRUE = b'I01\n'  # not an opcode; see INT docs in pickletools.py
 * cdef bytes FALSE = b'I00\n'  # not an opcode; see INT docs in pickletools.py             # <<<<<<<<<<<<<<
 * 
 * # Protocol 2
 */
  __Pyx_INCREF(__pyx_n_b_I00);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_FALSE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_FALSE, __pyx_n_b_I00);
  __Pyx_GIVEREF(__pyx_n_b_I00);

  /* "cycloudpickle/cypickle.pyx":121
 * # Protocol 2
 * 
 * cdef bytes PROTO = b'\x80'  # identify pickle protocol             # <<<<<<<<<<<<<<
 * cdef bytes NEWOBJ = b'\x81'  # build object by applying cls.__new__ to argtuple
 * cdef bytes EXT1 = b'\x82'  # push object from extension registry; 1-byte index
 */
  __Pyx_INCREF(__pyx_kp_b__27);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_PROTO);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_PROTO, __pyx_kp_b__27);
  __Pyx_GIVEREF(__pyx_kp_b__27);

  /* "cycloudpickle/cypickle.pyx":122
 * 
 * cdef bytes PROTO = b'\x80'  # identify pickle protocol
 * cdef bytes NEWOBJ = b'\x81'  # build object by applying cls.__new__ to argtuple             # <<<<<<<<<<<<<<
 * cdef bytes EXT1 = b'\x82'  # push object from extension registry; 1-byte index
 * cdef bytes EXT2 = b'\x83'  # ditto, but 2-byte index
 */
  __Pyx_INCREF(__pyx_kp_b__28);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ, __pyx_kp_b__28);
  __Pyx_GIVEREF(__pyx_kp_b__28);

  /* "cycloudpickle/cypickle.pyx":123
 * cdef bytes PROTO = b'\x80'  # identify pickle protocol
 * cdef bytes NEWOBJ = b'\x81'  # build object by applying cls.__new__ to argtuple
 * cdef bytes EXT1 = b'\x82'  # push object from extension registry; 1-byte index             # <<<<<<<<<<<<<<
 * cdef bytes EXT2 = b'\x83'  # ditto, but 2-byte index
 * cdef bytes EXT4 = b'\x84'  # ditto, but 4-byte index
 */
  __Pyx_INCREF(__pyx_kp_b__29);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EXT1);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EXT1, __pyx_kp_b__29);
  __Pyx_GIVEREF(__pyx_kp_b__29);

  /* "cycloudpickle/cypickle.pyx":124
 * cdef bytes NEWOBJ = b'\x81'  # build object by applying cls.__new__ to argtuple
 * cdef bytes EXT1 = b'\x82'  # push object from extension registry; 1-byte index
 * cdef bytes EXT2 = b'\x83'  # ditto, but 2-byte index             # <<<<<<<<<<<<<<
 * cdef bytes EXT4 = b'\x84'  # ditto, but 4-byte index
 * cdef bytes TUPLE1 = b'\x85'  # build 1-tuple from stack top
 */
  __Pyx_INCREF(__pyx_kp_b__30);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EXT2);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EXT2, __pyx_kp_b__30);
  __Pyx_GIVEREF(__pyx_kp_b__30);

  /* "cycloudpickle/cypickle.pyx":125
 * cdef bytes EXT1 = b'\x82'  # push object from extension registry; 1-byte index
 * cdef bytes EXT2 = b'\x83'  # ditto, but 2-byte index
 * cdef bytes EXT4 = b'\x84'  # ditto, but 4-byte index             # <<<<<<<<<<<<<<
 * cdef bytes TUPLE1 = b'\x85'  # build 1-tuple from stack top
 * cdef bytes TUPLE2 = b'\x86'  # build 2-tuple from two topmost stack items
 */
  __Pyx_INCREF(__pyx_kp_b__31);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EXT4);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EXT4, __pyx_kp_b__31);
  __Pyx_GIVEREF(__pyx_kp_b__31);

  /* "cycloudpickle/cypickle.pyx":126
 * cdef bytes EXT2 = b'\x83'  # ditto, but 2-byte index
 * cdef bytes EXT4 = b'\x84'  # ditto, but 4-byte index
 * cdef bytes TUPLE1 = b'\x85'  # build 1-tuple from stack top             # <<<<<<<<<<<<<<
 * cdef bytes TUPLE2 = b'\x86'  # build 2-tuple from two topmost stack items
 * cdef bytes TUPLE3 = b'\x87'  # build 3-tuple from three topmost stack items
 */
  __Pyx_INCREF(__pyx_kp_b__32);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE1);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_TUPLE1, __pyx_kp_b__32);
  __Pyx_GIVEREF(__pyx_kp_b__32);

  /* "cycloudpickle/cypickle.pyx":127
 * cdef bytes EXT4 = b'\x84'  # ditto, but 4-byte index
 * cdef bytes TUPLE1 = b'\x85'  # build 1-tuple from stack top
 * cdef bytes TUPLE2 = b'\x86'  # build 2-tuple from two topmost stack items             # <<<<<<<<<<<<<<
 * cdef bytes TUPLE3 = b'\x87'  # build 3-tuple from three topmost stack items
 * cdef bytes NEWTRUE = b'\x88'  # push True
 */
  __Pyx_INCREF(__pyx_kp_b__33);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE2);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_TUPLE2, __pyx_kp_b__33);
  __Pyx_GIVEREF(__pyx_kp_b__33);

  /* "cycloudpickle/cypickle.pyx":128
 * cdef bytes TUPLE1 = b'\x85'  # build 1-tuple from stack top
 * cdef bytes TUPLE2 = b'\x86'  # build 2-tuple from two topmost stack items
 * cdef bytes TUPLE3 = b'\x87'  # build 3-tuple from three topmost stack items             # <<<<<<<<<<<<<<
 * cdef bytes NEWTRUE = b'\x88'  # push True
 * cdef bytes NEWFALSE = b'\x89'  # push False
 */
  __Pyx_INCREF(__pyx_kp_b__34);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE3);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_TUPLE3, __pyx_kp_b__34);
  __Pyx_GIVEREF(__pyx_kp_b__34);

  /* "cycloudpickle/cypickle.pyx":129
 * cdef bytes TUPLE2 = b'\x86'  # build 2-tuple from two topmost stack items
 * cdef bytes TUPLE3 = b'\x87'  # build 3-tuple from three topmost stack items
 * cdef bytes NEWTRUE = b'\x88'  # push True             # <<<<<<<<<<<<<<
 * cdef bytes NEWFALSE = b'\x89'  # push False
 * cdef bytes LONG1 = b'\x8a'  # push long from < 256 bytes
 */
  __Pyx_INCREF(__pyx_kp_b__35);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_NEWTRUE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_NEWTRUE, __pyx_kp_b__35);
  __Pyx_GIVEREF(__pyx_kp_b__35);

  /* "cycloudpickle/cypickle.pyx":130
 * cdef bytes TUPLE3 = b'\x87'  # build 3-tuple from three topmost stack items
 * cdef bytes NEWTRUE = b'\x88'  # push True
 * cdef bytes NEWFALSE = b'\x89'  # push False             # <<<<<<<<<<<<<<
 * cdef bytes LONG1 = b'\x8a'  # push long from < 256 bytes
 * cdef bytes LONG4 = b'\x8b'  # push really big long
 */
  __Pyx_INCREF(__pyx_kp_b__36);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_NEWFALSE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_NEWFALSE, __pyx_kp_b__36);
  __Pyx_GIVEREF(__pyx_kp_b__36);

  /* "cycloudpickle/cypickle.pyx":131
 * cdef bytes NEWTRUE = b'\x88'  # push True
 * cdef bytes NEWFALSE = b'\x89'  # push False
 * cdef bytes LONG1 = b'\x8a'  # push long from < 256 bytes             # <<<<<<<<<<<<<<
 * cdef bytes LONG4 = b'\x8b'  # push really big long
 * 
 */
  __Pyx_INCREF(__pyx_kp_b__37);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_LONG1);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_LONG1, __pyx_kp_b__37);
  __Pyx_GIVEREF(__pyx_kp_b__37);

  /* "cycloudpickle/cypickle.pyx":132
 * cdef bytes NEWFALSE = b'\x89'  # push False
 * cdef bytes LONG1 = b'\x8a'  # push long from < 256 bytes
 * cdef bytes LONG4 = b'\x8b'  # push really big long             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _tuplesize2code = (EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3)
 */
  __Pyx_INCREF(__pyx_kp_b__38);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_LONG4);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_LONG4, __pyx_kp_b__38);
  __Pyx_GIVEREF(__pyx_kp_b__38);

  /* "cycloudpickle/cypickle.pyx":134
 * cdef bytes LONG4 = b'\x8b'  # push really big long
 * 
 * cdef tuple _tuplesize2code = (EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3)             # <<<<<<<<<<<<<<
 * 
 * # Protocol 3 (Python 3.x)
 */
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
  __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_13cycloudpickle_8cypickle_EMPTY_TUPLE);
  __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE1);
  __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE1);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_13cycloudpickle_8cypickle_TUPLE1);
  __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE2);
  __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_13cycloudpickle_8cypickle_TUPLE2);
  __Pyx_INCREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE3);
  __Pyx_GIVEREF(__pyx_v_13cycloudpickle_8cypickle_TUPLE3);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_13cycloudpickle_8cypickle_TUPLE3);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle__tuplesize2code);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle__tuplesize2code, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":138
 * # Protocol 3 (Python 3.x)
 * 
 * cdef bytes BINBYTES = b'B'  # push bytes; counted binary string argument             # <<<<<<<<<<<<<<
 * cdef bytes SHORT_BINBYTES = b'C'  #  "     "   ;    "      "       "      " < 256 bytes
 * 
 */
  __Pyx_INCREF(__pyx_n_b_B_2);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINBYTES);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINBYTES, __pyx_n_b_B_2);
  __Pyx_GIVEREF(__pyx_n_b_B_2);

  /* "cycloudpickle/cypickle.pyx":139
 * 
 * cdef bytes BINBYTES = b'B'  # push bytes; counted binary string argument
 * cdef bytes SHORT_BINBYTES = b'C'  #  "     "   ;    "      "       "      " < 256 bytes             # <<<<<<<<<<<<<<
 * 
 * # Protocol 4
 */
  __Pyx_INCREF(__pyx_n_b_C);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINBYTES);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINBYTES, __pyx_n_b_C);
  __Pyx_GIVEREF(__pyx_n_b_C);

  /* "cycloudpickle/cypickle.pyx":142
 * 
 * # Protocol 4
 * cdef bytes SHORT_BINUNICODE = b'\x8c'  # push short string; UTF-8 length < 256 bytes             # <<<<<<<<<<<<<<
 * cdef bytes BINUNICODE8 = b'\x8d'  # push very long string
 * cdef bytes BINBYTES8 = b'\x8e'  # push very long bytes string
 */
  __Pyx_INCREF(__pyx_kp_b__39);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINUNICODE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_SHORT_BINUNICODE, __pyx_kp_b__39);
  __Pyx_GIVEREF(__pyx_kp_b__39);

  /* "cycloudpickle/cypickle.pyx":143
 * # Protocol 4
 * cdef bytes SHORT_BINUNICODE = b'\x8c'  # push short string; UTF-8 length < 256 bytes
 * cdef bytes BINUNICODE8 = b'\x8d'  # push very long string             # <<<<<<<<<<<<<<
 * cdef bytes BINBYTES8 = b'\x8e'  # push very long bytes string
 * cdef bytes EMPTY_SET = b'\x8f'  # push empty set on the stack
 */
  __Pyx_INCREF(__pyx_kp_b__40);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINUNICODE8);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINUNICODE8, __pyx_kp_b__40);
  __Pyx_GIVEREF(__pyx_kp_b__40);

  /* "cycloudpickle/cypickle.pyx":144
 * cdef bytes SHORT_BINUNICODE = b'\x8c'  # push short string; UTF-8 length < 256 bytes
 * cdef bytes BINUNICODE8 = b'\x8d'  # push very long string
 * cdef bytes BINBYTES8 = b'\x8e'  # push very long bytes string             # <<<<<<<<<<<<<<
 * cdef bytes EMPTY_SET = b'\x8f'  # push empty set on the stack
 * cdef bytes ADDITEMS = b'\x90'  # modify set by adding topmost stack items
 */
  __Pyx_INCREF(__pyx_kp_b__41);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_BINBYTES8);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_BINBYTES8, __pyx_kp_b__41);
  __Pyx_GIVEREF(__pyx_kp_b__41);

  /* "cycloudpickle/cypickle.pyx":145
 * cdef bytes BINUNICODE8 = b'\x8d'  # push very long string
 * cdef bytes BINBYTES8 = b'\x8e'  # push very long bytes string
 * cdef bytes EMPTY_SET = b'\x8f'  # push empty set on the stack             # <<<<<<<<<<<<<<
 * cdef bytes ADDITEMS = b'\x90'  # modify set by adding topmost stack items
 * cdef bytes FROZENSET = b'\x91'  # build frozenset from topmost stack items
 */
  __Pyx_INCREF(__pyx_kp_b__42);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_EMPTY_SET);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_EMPTY_SET, __pyx_kp_b__42);
  __Pyx_GIVEREF(__pyx_kp_b__42);

  /* "cycloudpickle/cypickle.pyx":146
 * cdef bytes BINBYTES8 = b'\x8e'  # push very long bytes string
 * cdef bytes EMPTY_SET = b'\x8f'  # push empty set on the stack
 * cdef bytes ADDITEMS = b'\x90'  # modify set by adding topmost stack items             # <<<<<<<<<<<<<<
 * cdef bytes FROZENSET = b'\x91'  # build frozenset from topmost stack items
 * cdef bytes NEWOBJ_EX = b'\x92'  # like NEWOBJ but work with keyword only arguments
 */
  __Pyx_INCREF(__pyx_kp_b__43);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_ADDITEMS);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_ADDITEMS, __pyx_kp_b__43);
  __Pyx_GIVEREF(__pyx_kp_b__43);

  /* "cycloudpickle/cypickle.pyx":147
 * cdef bytes EMPTY_SET = b'\x8f'  # push empty set on the stack
 * cdef bytes ADDITEMS = b'\x90'  # modify set by adding topmost stack items
 * cdef bytes FROZENSET = b'\x91'  # build frozenset from topmost stack items             # <<<<<<<<<<<<<<
 * cdef bytes NEWOBJ_EX = b'\x92'  # like NEWOBJ but work with keyword only arguments
 * cdef bytes STACK_GLOBAL = b'\x93'  # same as GLOBAL but using names on the stacks
 */
  __Pyx_INCREF(__pyx_kp_b__44);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_FROZENSET);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_FROZENSET, __pyx_kp_b__44);
  __Pyx_GIVEREF(__pyx_kp_b__44);

  /* "cycloudpickle/cypickle.pyx":148
 * cdef bytes ADDITEMS = b'\x90'  # modify set by adding topmost stack items
 * cdef bytes FROZENSET = b'\x91'  # build frozenset from topmost stack items
 * cdef bytes NEWOBJ_EX = b'\x92'  # like NEWOBJ but work with keyword only arguments             # <<<<<<<<<<<<<<
 * cdef bytes STACK_GLOBAL = b'\x93'  # same as GLOBAL but using names on the stacks
 * cdef bytes MEMOIZE = b'\x94'  # store top of the stack in memo
 */
  __Pyx_INCREF(__pyx_kp_b__45);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_NEWOBJ_EX, __pyx_kp_b__45);
  __Pyx_GIVEREF(__pyx_kp_b__45);

  /* "cycloudpickle/cypickle.pyx":149
 * cdef bytes FROZENSET = b'\x91'  # build frozenset from topmost stack items
 * cdef bytes NEWOBJ_EX = b'\x92'  # like NEWOBJ but work with keyword only arguments
 * cdef bytes STACK_GLOBAL = b'\x93'  # same as GLOBAL but using names on the stacks             # <<<<<<<<<<<<<<
 * cdef bytes MEMOIZE = b'\x94'  # store top of the stack in memo
 * cdef bytes FRAME = b'\x95'  # indicate the beginning of a new frame
 */
  __Pyx_INCREF(__pyx_kp_b__46);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_STACK_GLOBAL, __pyx_kp_b__46);
  __Pyx_GIVEREF(__pyx_kp_b__46);

  /* "cycloudpickle/cypickle.pyx":150
 * cdef bytes NEWOBJ_EX = b'\x92'  # like NEWOBJ but work with keyword only arguments
 * cdef bytes STACK_GLOBAL = b'\x93'  # same as GLOBAL but using names on the stacks
 * cdef bytes MEMOIZE = b'\x94'  # store top of the stack in memo             # <<<<<<<<<<<<<<
 * cdef bytes FRAME = b'\x95'  # indicate the beginning of a new frame
 * 
 */
  __Pyx_INCREF(__pyx_kp_b__47);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_MEMOIZE);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_MEMOIZE, __pyx_kp_b__47);
  __Pyx_GIVEREF(__pyx_kp_b__47);

  /* "cycloudpickle/cypickle.pyx":151
 * cdef bytes STACK_GLOBAL = b'\x93'  # same as GLOBAL but using names on the stacks
 * cdef bytes MEMOIZE = b'\x94'  # store top of the stack in memo
 * cdef bytes FRAME = b'\x95'  # indicate the beginning of a new frame             # <<<<<<<<<<<<<<
 * 
 * __all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$", x)])
 */
  __Pyx_INCREF(__pyx_kp_b__48);
  __Pyx_XGOTREF(__pyx_v_13cycloudpickle_8cypickle_FRAME);
  __Pyx_DECREF_SET(__pyx_v_13cycloudpickle_8cypickle_FRAME, __pyx_kp_b__48);
  __Pyx_GIVEREF(__pyx_kp_b__48);

  /* "cycloudpickle/cypickle.pyx":153
 * cdef bytes FRAME = b'\x95'  # indicate the beginning of a new frame
 * 
 * __all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$", x)])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_all); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  { /* enter inner scope */
    PyObject *__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x = NULL;
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_x);
    __Pyx_GIVEREF(__pyx_n_s_x);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_x);
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_6 >= 1) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_match); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_9 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_A_Z_A_Z0_9);
      __Pyx_GIVEREF(__pyx_kp_u_A_Z_A_Z0_9);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_u_A_Z_A_Z0_9);
      __Pyx_INCREF(__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x);
      __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_11) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x);
    goto __pyx_L8_exit_scope;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_13cycloudpickle_8cypickle_x);
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":157
 * 
 * cdef class _Framer:
 *     _FRAME_SIZE_TARGET = 64 * 1024             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, file_write):
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle__Framer->tp_dict, __pyx_n_s_FRAME_SIZE_TARGET, __pyx_int_65536) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_13cycloudpickle_8cypickle__Framer);

  /* "cycloudpickle/cypickle.pyx":540
 *     # Methods below this point are dispatched through the dispatch table
 * 
 *     dispatch = {}             # <<<<<<<<<<<<<<
 * 
 *     def save_none(self, obj):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_dict, __pyx_n_s_dispatch, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_13cycloudpickle_8cypickle_Pickler);

  /* "cycloudpickle/cypickle.pyx":544
 *     def save_none(self, obj):
 *         self.write(NONE)
 *     dispatch[type(None)] = save_none             # <<<<<<<<<<<<<<
 * 
 *     def save_bool(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_none); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)Py_TYPE(Py_None)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":551
 *         else:
 *             self.write(TRUE if obj else FALSE)
 *     dispatch[bool] = save_bool             # <<<<<<<<<<<<<<
 * 
 *     def save_long(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject*)&PyBool_Type), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":579
 *             return
 *         self.write(LONG + repr(obj).encode("ascii") + b'L\n')
 *     dispatch[int] = save_long             # <<<<<<<<<<<<<<
 * 
 *     def save_float(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_long); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyInt_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":586
 *         else:
 *             self.write(FLOAT + repr(obj).encode("ascii") + b'\n')
 *     dispatch[float] = save_float             # <<<<<<<<<<<<<<
 * 
 *     def save_bytes(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_float); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyFloat_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":604
 *             self.write(BINBYTES + pack("<I", n) + obj)
 *         self.memoize(obj)
 *     dispatch[bytes] = save_bytes             # <<<<<<<<<<<<<<
 * 
 *     def save_str(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyBytes_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":622
 *                        b'\n')
 *         self.memoize(obj)
 *     dispatch[str] = save_str             # <<<<<<<<<<<<<<
 * 
 *     def save_tuple(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyUnicode_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":673
 *         self.memoize(obj)
 * 
 *     dispatch[tuple] = save_tuple             # <<<<<<<<<<<<<<
 * 
 *     def save_list(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_tuple); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyTuple_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":684
 *         self._batch_appends(obj)
 * 
 *     dispatch[list] = save_list             # <<<<<<<<<<<<<<
 * 
 *     _BATCHSIZE = 1000
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyList_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":686
 *     dispatch[list] = save_list
 * 
 *     _BATCHSIZE = 1000             # <<<<<<<<<<<<<<
 * 
 *     def _batch_appends(self, items):
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_dict, __pyx_n_s_BATCHSIZE, __pyx_int_1000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_13cycloudpickle_8cypickle_Pickler);

  /* "cycloudpickle/cypickle.pyx":725
 *         self.memoize(obj)
 *         self._batch_setitems(obj.items())
 *     dispatch[dict] = save_dict             # <<<<<<<<<<<<<<
 * 
 *     def _batch_setitems(self, items):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyDict_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":780
 *             if n < self._BATCHSIZE:
 *                 return
 *     dispatch[set] = save_set             # <<<<<<<<<<<<<<
 * 
 *     def save_frozenset(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PySet_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":803
 *         write(FROZENSET)
 *         self.memoize(obj)
 *     dispatch[frozenset] = save_frozenset             # <<<<<<<<<<<<<<
 * 
 *     def save_global(self, obj, name=None):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_frozenset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, ((PyObject *)(&PyFrozenSet_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":875
 *         return self.save_global(obj)
 * 
 *     dispatch[FunctionType] = save_global             # <<<<<<<<<<<<<<
 *     dispatch[type] = save_type
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_global); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FunctionType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":876
 * 
 *     dispatch[FunctionType] = save_global
 *     dispatch[type] = save_type             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_save_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, ((PyObject *)(&PyType_Type)), __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cypickle.pyx":1
 * """             # <<<<<<<<<<<<<<
 * This file is an adaptation of python pickle (not cPickle) to use Cython.
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cycloudpickle.cypickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cycloudpickle.cypickle");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(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]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (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]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(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]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (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]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_RshiftObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            return PyInt_FromLong(a >> b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(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]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (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]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(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]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (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]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_rshift(op1, op2);
            }
        }
                x = a >> b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla >> llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    return (inplace ? PyNumber_InPlaceRshift : PyNumber_Rshift)(op1, op2);
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            return PyInt_FromLong(a & b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(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]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (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]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(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]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (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]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_and(op1, op2);
            }
        }
                x = a & b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla & llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2);
}
#endif

static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    } else {
        if (default_value == Py_None)
            default_value = NULL;
        value = PyObject_CallMethodObjArgs(
            d, __pyx_n_s_get, key, default_value, NULL);
    }
#endif
    return value;
}

static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __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])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (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]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(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]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
