/* Generated by Cython 0.29.21 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "asynctnt/iproto/tupleobj/tupleobj.h",
            "third_party/msgpuck/msgpuck.h"
        ],
        "include_dirs": [
            "asynctnt/iproto",
            "third_party"
        ],
        "name": "asynctnt.iproto.protocol",
        "sources": [
            "asynctnt/iproto/protocol.pyx",
            "third_party/msgpuck/msgpuck.c",
            "third_party/msgpuck/hints.c",
            "asynctnt/iproto/tupleobj/tupleobj.c"
        ]
    },
    "module_name": "asynctnt.iproto.protocol"
}
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 < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_21"
#define CYTHON_HEX_VERSION 0x001D15F0
#define CYTHON_FUTURE_DIVISION 1
#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
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#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_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#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
#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_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif 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 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"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #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)
#endif
  #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
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #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_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#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_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #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)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #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_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #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]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#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
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? 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 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#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
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#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
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#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) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#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 defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

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

#define __PYX_HAVE__asynctnt__iproto__protocol
#define __PYX_HAVE_API__asynctnt__iproto__protocol
/* Early includes */
#include <string.h>
#include <stdio.h>
#include "pythread.h"
#include "tupleobj/tupleobj.h"
#include <stdint.h>
#include "../../third_party/msgpuck/msgpuck.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const 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_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#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)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#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)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_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 const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const 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_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const 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)
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);
}
#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)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#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
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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) + 1);
    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 CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
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[] = {
  "asynctnt/iproto/schema.pyx",
  "stringsource",
  "asynctnt/iproto/buffer.pyx",
  "asynctnt/iproto/response.pyx",
  "asynctnt/iproto/push.pyx",
  "asynctnt/iproto/protocol.pyx",
  "asynctnt/iproto/unicodeutil.pyx",
  "asynctnt/iproto/rbuffer.pyx",
  "asynctnt/iproto/request.pyx",
  "asynctnt/iproto/db.pyx",
  "asynctnt/iproto/coreproto.pyx",
  ".eggs/Cython-0.29.21-py3.8-linux-x86_64.egg/Cython/Includes/cpython/type.pxd",
  ".eggs/Cython-0.29.21-py3.8-linux-x86_64.egg/Cython/Includes/cpython/bool.pxd",
  ".eggs/Cython-0.29.21-py3.8-linux-x86_64.egg/Cython/Includes/cpython/complex.pxd",
};

/*--- Type declarations ---*/
struct C_TntFields;
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex;
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex;
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace;
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace;
struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema;
struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer;
struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer;
struct __pyx_obj_8asynctnt_6iproto_8protocol_Request;
struct __pyx_obj_8asynctnt_6iproto_8protocol_Response;
struct __pyx_obj_8asynctnt_6iproto_8protocol_Db;
struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator;
struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol;
struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol;
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex;
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr;
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__;
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth;
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema;

/* "asynctnt/iproto/tarantool.pxd":1
 * cdef enum iproto_header_key:             # <<<<<<<<<<<<<<
 *     IPROTO_REQUEST_TYPE = 0x00
 *     IPROTO_SYNC = 0x01
 */
enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_header_key {
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_REQUEST_TYPE = 0x00,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SYNC = 0x01,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_REPLICA_ID = 0x02,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_LSN = 0x03,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TIMESTAMP = 0x04,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SCHEMA_VERSION = 0x05,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SERVER_VERSION = 0x06,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_GROUP_ID = 0x07
};

/* "asynctnt/iproto/tarantool.pxd":12
 * 
 * 
 * cdef enum iproto_key:             # <<<<<<<<<<<<<<
 *     IPROTO_SPACE_ID = 0x10
 *     IPROTO_INDEX_ID = 0x11
 */
enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_key {
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SPACE_ID = 0x10,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INDEX_ID = 0x11,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_LIMIT = 0x12,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OFFSET = 0x13,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_ITERATOR = 0x14,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INDEX_BASE = 0x15,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_KEY = 0x20,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE = 0x21,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_FUNCTION_NAME = 0x22,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_USER_NAME = 0x23,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INSTANCE_UUID = 0x24,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CLUSTER_UUID = 0x25,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_VCLOCK = 0x26,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_EXPR = 0x27,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OPS = 0x28,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_BALLOT = 0x29,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE_META = 0x2a,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OPTIONS = 0x2b,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_DATA = 0x30,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_ERROR = 0x31,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_METADATA = 0x32,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SQL_TEXT = 0x40,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SQL_BIND = 0x41,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SQL_INFO = 0x42
};

/* "asynctnt/iproto/tarantool.pxd":42
 * 
 * 
 * cdef enum iproto_metadata_key:             # <<<<<<<<<<<<<<
 *     IPROTO_FIELD_NAME = 0
 *     IPROTO_FIELD_TYPE = 1
 */
enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_metadata_key {
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_FIELD_NAME = 0,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_FIELD_TYPE = 1
};

/* "asynctnt/iproto/tarantool.pxd":47
 * 
 * 
 * cdef enum iproto_sql_info_key:             # <<<<<<<<<<<<<<
 *     SQL_INFO_ROW_COUNT = 0
 *     SQL_INFO_AUTOINCREMENT_IDS = 1
 */
enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_sql_info_key {
  __pyx_e_8asynctnt_6iproto_9tarantool_SQL_INFO_ROW_COUNT = 0,
  __pyx_e_8asynctnt_6iproto_9tarantool_SQL_INFO_AUTOINCREMENT_IDS = 1
};

/* "asynctnt/iproto/tarantool.pxd":52
 * 
 * 
 * cdef enum iproto_type:             # <<<<<<<<<<<<<<
 *     IPROTO_OK = 0
 *     IPROTO_SELECT = 1
 */
enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type {
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OK = 0,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SELECT = 1,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INSERT = 2,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_REPLACE = 3,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_UPDATE = 4,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_DELETE = 5,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CALL_16 = 6,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_AUTH = 7,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_EVAL = 8,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_UPSERT = 9,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CALL = 10,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_EXECUTE = 11,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_PING = 64,
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CHUNK = 0x80
};

/* "asynctnt/iproto/tarantool.pxd":69
 *     IPROTO_CHUNK = 128
 * 
 * cdef enum iproto_update_operation:             # <<<<<<<<<<<<<<
 *     IPROTO_OP_ADD = b'+'
 *     IPROTO_OP_SUB = b'-'
 */
enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_update_operation {

  /* "asynctnt/iproto/tarantool.pxd":78
 *     IPROTO_OP_INSERT = b'!'
 *     IPROTO_OP_ASSIGN = b'='
 *     IPROTO_OP_SPLICE = b':'             # <<<<<<<<<<<<<<
 */
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_ADD = '+',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_SUB = '-',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_AND = '&',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_XOR = '^',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_OR = '|',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_DELETE = '#',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_INSERT = '!',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_ASSIGN = '=',
  __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_SPLICE = ':'
};
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index;
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence;
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update;
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new;
struct __pyx_t_8asynctnt_6iproto_8protocol_Header;

/* "asynctnt/iproto/coreproto.pxd":1
 * cdef enum ProtocolState:             # <<<<<<<<<<<<<<
 *     PROTOCOL_IDLE = 0
 *     PROTOCOL_GREETING = 1
 */
enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState {
  __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_IDLE = 0,
  __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_GREETING = 1,
  __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_NORMAL = 2
};

/* "asynctnt/iproto/coreproto.pxd":7
 * 
 * 
 * cdef enum ConnectionState:             # <<<<<<<<<<<<<<
 *     CONNECTION_BAD = 0
 *     CONNECTION_CONNECTED = 1
 */
enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState {
  __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_BAD = 0,
  __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_CONNECTED = 1,
  __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_FULL = 2
};

/* "asynctnt/iproto/schema.pxd":43
 * 
 *     cdef void add_index(self, SchemaIndex idx)
 *     cdef SchemaIndex get_index(self, index, create_dummy=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index {
  int __pyx_n;
  PyObject *create_dummy;
};

/* "asynctnt/iproto/buffer.pxd":51
 *     cdef char *_encode_tuple(self, char *p, tuple t) except NULL
 *     cdef char *_encode_dict(self, char *p, dict d) except NULL
 *     cdef char *_encode_key_sequence(self, char *p, t,             # <<<<<<<<<<<<<<
 *                                     TntFields fields=*,
 *                                     bint default_none=*) except NULL
 */
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence {
  int __pyx_n;
  struct C_TntFields *fields;
  int default_none;
};

/* "asynctnt/iproto/buffer.pxd":66
 *     cdef void encode_request_delete(self, SchemaSpace space, SchemaIndex index,
 *                                     key) except *
 *     cdef void encode_request_update(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key_tuple, list operations,
 *                                     bint is_upsert=*) except *
 */
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update {
  int __pyx_n;
  int is_upsert;
};

/* "asynctnt/iproto/rbuffer.pxd":31
 * 
 *     @staticmethod
 *     cdef ReadBuffer new(str encoding, size_t initial_buffer_size=*)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _reallocate(self, size_t new_size) except *
 */
struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new {
  int __pyx_n;
  size_t initial_buffer_size;
};

/* "asynctnt/iproto/response.pxd":3
 * from libc.stdint cimport uint64_t, uint32_t, int64_t, int32_t
 * 
 * cdef struct Header:             # <<<<<<<<<<<<<<
 *     int32_t code
 *     int32_t return_code
 */
struct __pyx_t_8asynctnt_6iproto_8protocol_Header {
  int32_t code;
  int32_t return_code;
  uint64_t sync;
  int64_t schema_id;
};

/* "asynctnt/iproto/schema.pxd":4
 * 
 * 
 * cdef public class TntFields [object C_TntFields, type C_TntFields_Type]:             # <<<<<<<<<<<<<<
 *     cdef:
 *         list _names  # contains only field names ('f1', 'f2', ...)
 */
struct C_TntFields {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_TntFields *__pyx_vtab;
  PyObject *_names;
  PyObject *_mapping;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) C_TntFields_Type;

/* "asynctnt/iproto/schema.pxd":15
 * 
 * 
 * cdef class SchemaIndex:             # <<<<<<<<<<<<<<
 *     cdef:
 *         int sid
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex {
  PyObject_HEAD
  int sid;
  int iid;
  PyObject *name;
  PyObject *index_type;
  PyObject *unique;
  struct C_TntFields *fields;
};


/* "asynctnt/iproto/schema.pxd":26
 * 
 * 
 * cdef class SchemaDummyIndex(SchemaIndex):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex __pyx_base;
};


/* "asynctnt/iproto/schema.pxd":30
 * 
 * 
 * cdef class SchemaSpace:             # <<<<<<<<<<<<<<
 *     cdef:
 *         int sid
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_vtab;
  int sid;
  int owner;
  PyObject *name;
  PyObject *engine;
  int field_count;
  PyObject *flags;
  struct C_TntFields *fields;
  PyObject *indexes;
};


/* "asynctnt/iproto/schema.pxd":46
 * 
 * 
 * cdef class SchemaDummySpace(SchemaSpace):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace __pyx_base;
};


/* "asynctnt/iproto/schema.pxd":50
 * 
 * 
 * cdef class Schema:             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict schema
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *__pyx_vtab;
  PyObject *schema;
  int64_t id;
};


/* "asynctnt/iproto/buffer.pxd":4
 * 
 * 
 * cdef class WriteBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Preallocated small buffer
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_vtab;
  int _smallbuf_inuse;
  char _smallbuf[0x400];
  char *_buf;
  Py_ssize_t _size;
  Py_ssize_t _length;
  int _view_count;
  PyObject *_encoding;
  Py_ssize_t __pyx___op_offset;
  Py_ssize_t __pyx___sync_offset;
  Py_ssize_t __pyx___schema_id_offset;
};


/* "asynctnt/iproto/rbuffer.pxd":21
 * 
 * 
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         char *buf
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_vtab;
  char *buf;
  size_t initial_buffer_size;
  size_t len;
  size_t use;
  PyObject *encoding;
};


/* "asynctnt/iproto/request.pxd":4
 * 
 * 
 * cdef class Request:             # <<<<<<<<<<<<<<
 *     cdef:
 *         tarantool.iproto_type op
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_Request {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Request *__pyx_vtab;
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type op;
  uint64_t sync;
  int64_t schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *space;
  PyObject *waiter;
  PyObject *timeout_handle;
  int parse_metadata;
  int parse_as_tuples;
  int push_subscribe;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *response;
};


/* "asynctnt/iproto/response.pxd":10
 * 
 * 
 * cdef class Response:             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t _code
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_Response {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Response *__pyx_vtab;
  int32_t _code;
  int32_t _return_code;
  uint64_t _sync;
  int64_t _schema_id;
  PyObject *_errmsg;
  int _rowcount;
  PyObject *_body;
  PyObject *_encoding;
  struct C_TntFields *_fields;
  PyObject *_autoincrement_ids;
  int _push_subscribe;
  PyObject *_exception;
  PyObject *_q;
  PyObject *_push_event;
  PyObject *_q_append;
  PyObject *_q_popleft;
  PyObject *_push_event_set;
  PyObject *_push_event_clear;
};


/* "asynctnt/iproto/db.pxd":4
 * 
 * 
 * cdef class Db:             # <<<<<<<<<<<<<<
 *     cdef:
 *         BaseProtocol _protocol
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_Db {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *__pyx_vtab;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *_protocol;
  PyObject *_encoding;
};


/* "asynctnt/iproto/push.pxd":2
 * 
 * cdef class PushIterator:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object _fut
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator {
  PyObject_HEAD
  PyObject *_fut;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *_request;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *_response;
};


/* "asynctnt/iproto/coreproto.pxd":13
 * 
 * 
 * cdef class CoreProtocol:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object host
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol {
  PyObject_HEAD
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_vtab;
  PyObject *host;
  PyObject *port;
  PyObject *encoding;
  enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState state;
  enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState con_state;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *rbuf;
  PyObject *version;
  PyObject *salt;
};


/* "asynctnt/iproto/protocol.pxd":21
 * 
 * 
 * cdef class BaseProtocol(CoreProtocol):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object loop
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol __pyx_base;
  PyObject *loop;
  PyObject *username;
  PyObject *password;
  int fetch_schema;
  int auto_refetch_schema;
  float request_timeout;
  PyObject *connected_fut;
  PyObject *on_connection_made_cb;
  PyObject *on_connection_lost_cb;
  PyObject *_on_request_completed_cb;
  PyObject *_on_request_timeout_cb;
  PyObject *_reqs;
  uint64_t _sync;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *_schema;
  int64_t _schema_id;
  int _schema_fetch_in_progress;
  PyObject *_refetch_schema_future;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *_db;
  PyObject *create_future;
};


/* "asynctnt/iproto/buffer.pyx":54
 *         self._view_count -= 1
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))
 *                         for i in range(self._length))
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex {
  PyObject_HEAD
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self;
};


/* "asynctnt/iproto/buffer.pyx":55
 * 
 *     def hex(self):
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))             # <<<<<<<<<<<<<<
 *                         for i in range(self._length))
 * 
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *__pyx_outer_scope;
  Py_ssize_t __pyx_v_i;
};


/* "asynctnt/iproto/push.pyx":60
 * 
 *     @cython.iterable_coroutine
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         cdef Response response
 *         response = self._response
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ {
  PyObject_HEAD
  PyObject *__pyx_v_ev;
  PyObject *__pyx_v_exc;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_response;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self;
};


/* "asynctnt/iproto/protocol.pyx":188
 *         waiter.set_result(req.response)
 * 
 *     cdef void _do_auth(self, str username, str password):             # <<<<<<<<<<<<<<
 *         # No extra error handling from Db.execute
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth {
  PyObject_HEAD
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self;
};


/* "asynctnt/iproto/protocol.pyx":212
 *         fut.add_done_callback(on_authorized)
 * 
 *     cdef void _do_fetch_schema(self, object fut):             # <<<<<<<<<<<<<<
 *         if self._schema_fetch_in_progress:
 *             return
 */
struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema {
  PyObject_HEAD
  PyObject *__pyx_v_fut;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self;
};


__PYX_EXTERN_C DL_EXPORT(PyTypeObject) C_TntFields_Type;

/* "asynctnt/iproto/schema.pyx":14
 * @cython.final
 * @cython.freelist(TNT_FIELDS_FREELIST_SIZE)
 * cdef public class TntFields [object C_TntFields, type C_TntFields_Type]:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self._names = []
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_TntFields {
  int (*len)(struct C_TntFields *);
  void (*add)(struct C_TntFields *, uint64_t, PyObject *);
  PyObject *(*name_by_id)(struct C_TntFields *, int);
  uint64_t (*id_by_name)(struct C_TntFields *, PyObject *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_TntFields *__pyx_vtabptr_8asynctnt_6iproto_8protocol_TntFields;
static CYTHON_INLINE int __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(struct C_TntFields *);
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(struct C_TntFields *, uint64_t, PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(struct C_TntFields *, int);
static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_id_by_name(struct C_TntFields *, PyObject *);


/* "asynctnt/iproto/schema.pyx":64
 * 
 * 
 * cdef class SchemaSpace:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self.sid = -1
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace {
  void (*add_index)(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *(*get_index)(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index *__pyx_optional_args);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaSpace;


/* "asynctnt/iproto/schema.pyx":121
 * 
 * 
 * cdef class SchemaDummySpace(SchemaSpace):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaDummySpace {
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace __pyx_base;
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaDummySpace *__pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaDummySpace;


/* "asynctnt/iproto/schema.pyx":125
 * 
 * 
 * cdef class Schema:             # <<<<<<<<<<<<<<
 *     def __cinit__(self, int64_t schema_id):
 *         self.id = schema_id
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*get_space)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*create_dummy_space)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, int);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*get_or_create_space)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*parse_space)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *(*parse_index)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *);
  PyObject *(*clear)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *(*parse)(int64_t, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *__pyx_vtabptr_8asynctnt_6iproto_8protocol_Schema;
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_clear(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *);


/* "asynctnt/iproto/buffer.pyx":21
 * @cython.final
 * @cython.freelist(_BUFFER_FREELIST_SIZE)
 * cdef class WriteBuffer:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self._smallbuf_inuse = True
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_WriteBuffer {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *(*new)(PyObject *);
  PyObject *(*_check_readonly)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
  PyObject *(*len)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
  void (*ensure_allocated)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, Py_ssize_t);
  char *(*_ensure_allocated)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, Py_ssize_t);
  void (*_reallocate)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, Py_ssize_t);
  void (*write_buffer)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
  void (*write_header)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, uint64_t, enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, int64_t);
  void (*change_schema_id)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, int64_t);
  void (*write_length)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
  char *(*_encode_nil)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *);
  char *(*_encode_bool)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, int);
  char *(*_encode_double)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, double);
  char *(*_encode_uint)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint64_t);
  char *(*_encode_int)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, int64_t);
  char *(*_encode_str)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, char const *, uint32_t);
  char *(*_encode_bin)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, char const *, uint32_t);
  char *(*_encode_array)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint32_t);
  char *(*_encode_map)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint32_t);
  char *(*_encode_list)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
  char *(*_encode_tuple)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
  char *(*_encode_dict)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
  char *(*_encode_key_sequence)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence *__pyx_optional_args);
  char *(*_encode_obj)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
  char *(*_encode_update_ops)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *);
  void (*encode_request_call)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
  void (*encode_request_eval)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
  void (*encode_request_select)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, uint64_t, uint64_t, uint32_t);
  void (*encode_request_insert)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *);
  void (*encode_request_delete)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *);
  void (*encode_request_update)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update *__pyx_optional_args);
  void (*encode_request_upsert)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, PyObject *);
  void (*encode_request_sql)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
  void (*encode_request_auth)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_vtabptr_8asynctnt_6iproto_8protocol_WriteBuffer;
static struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__check_readonly(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_len(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, Py_ssize_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, Py_ssize_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__reallocate(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, Py_ssize_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_buffer(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, uint64_t, enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, int64_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_change_schema_id(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, int64_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_nil(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bool(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, int);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_double(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, double);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint64_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_int(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, int64_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_str(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, char const *, uint32_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bin(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, char const *, uint32_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint32_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_map(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint32_t);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_tuple(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_dict(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence *__pyx_optional_args);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *);
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_update_ops(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_call(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_select(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, uint64_t, uint64_t, uint32_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update *__pyx_optional_args);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, PyObject *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *);


/* "asynctnt/iproto/rbuffer.pyx":10
 * @cython.no_gc_clear
 * @cython.final
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self.buf = NULL
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_ReadBuffer {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *(*new)(PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new *__pyx_optional_args);
  void (*_reallocate)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
  int (*extend)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, char const *, size_t);
  void (*move)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
  void (*move_offset)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, Py_ssize_t, size_t);
  PyObject *(*get_slice)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t, size_t);
  PyObject *(*get_slice_begin)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
  PyObject *(*get_slice_end)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_vtabptr_8asynctnt_6iproto_8protocol_ReadBuffer;
static struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_new(PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new *__pyx_optional_args);
static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
static int __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_extend(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, char const *, size_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move_offset(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, Py_ssize_t, size_t);
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t, size_t);
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_begin(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_end(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t);


/* "asynctnt/iproto/request.pyx":7
 * @cython.final
 * @cython.freelist(REQUEST_FREELIST)
 * cdef class Request:             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     cdef inline Request new(tarantool.iproto_type op,
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Request {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *(*new)(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, uint64_t, int64_t, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, int);
  struct C_TntFields *(*fields)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Request *__pyx_vtabptr_8asynctnt_6iproto_8protocol_Request;
static CYTHON_INLINE struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, uint64_t, int64_t, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, int);
static CYTHON_INLINE struct C_TntFields *__pyx_f_8asynctnt_6iproto_8protocol_7Request_fields(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *);


/* "asynctnt/iproto/response.pyx":17
 * @cython.final
 * @cython.freelist(REQUEST_FREELIST)
 * cdef class Response:             # <<<<<<<<<<<<<<
 *     """
 *         Response object for all the requests to Tarantool
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Response {
  int (*is_error)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
  uint32_t (*_len)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
  void (*add_push)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *);
  PyObject *(*pop_push)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
  PyObject *(*push_len)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
  void (*set_data)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *);
  void (*set_exception)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *);
  PyObject *(*get_exception)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
  void (*notify)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Response *__pyx_vtabptr_8asynctnt_6iproto_8protocol_Response;
static CYTHON_INLINE int __pyx_f_8asynctnt_6iproto_8protocol_8Response_is_error(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
static CYTHON_INLINE uint32_t __pyx_f_8asynctnt_6iproto_8protocol_8Response__len(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_add_push(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_pop_push(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_data(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *);
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_get_exception(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_notify(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *);


/* "asynctnt/iproto/db.pyx":5
 * import hashlib
 * 
 * cdef class Db:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self._protocol = None
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *(*new)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);
  uint64_t (*next_sync)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *);
  PyObject *(*_ping)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, float, int);
  PyObject *(*_call16)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, float, int);
  PyObject *(*_call)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, float, int);
  PyObject *(*_eval)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, float, int);
  PyObject *(*_select)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, uint64_t, uint64_t, uint32_t, float, int);
  PyObject *(*_insert)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, int, float, int);
  PyObject *(*_delete)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, float, int);
  PyObject *(*_update)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, PyObject *, float, int);
  PyObject *(*_upsert)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, PyObject *, float, int);
  PyObject *(*_sql)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, int, float, int);
  PyObject *(*_auth)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, PyObject *, float, int);
  PyObject *(*_sha1)(PyObject *);
  PyObject *(*_strxor)(PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *__pyx_vtabptr_8asynctnt_6iproto_8protocol_Db;
static CYTHON_INLINE struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_f_8asynctnt_6iproto_8protocol_2Db_new(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);
static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *);


/* "asynctnt/iproto/coreproto.pyx":19
 * 
 * 
 * cdef class CoreProtocol:             # <<<<<<<<<<<<<<
 *     def __init__(self,
 *                  host, port,
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol {
  int (*_is_connected)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *);
  int (*_is_fully_connected)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *);
  void (*_write)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *);
  void (*_on_data_received)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *);
  void (*_process__greeting)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *);
  void (*_on_greeting_received)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *);
  void (*_on_response_received)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, char const *, uint32_t);
  void (*_on_connection_made)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *);
  void (*_on_connection_lost)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_vtabptr_8asynctnt_6iproto_8protocol_CoreProtocol;


/* "asynctnt/iproto/protocol.pyx":42
 * 
 * 
 * cdef class BaseProtocol(CoreProtocol):             # <<<<<<<<<<<<<<
 *     def __init__(self, host, port,
 *                  username, password,
 */

struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol {
  struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol __pyx_base;
  void (*_set_connection_ready)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);
  void (*_set_connection_error)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *);
  void (*_do_auth)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *, PyObject *);
  void (*_do_fetch_schema)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_refetch_schema)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);
  uint64_t (*next_sync)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);
  uint32_t (*transform_iterator)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_new_waiter_for_request)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, float);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *(*_create_db)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);
  PyObject *(*execute)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, float);
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_vtabptr_8asynctnt_6iproto_8protocol_BaseProtocol;
static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_next_sync(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *);

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#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)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* RaiseArgTupleInvalid.proto */
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);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall.proto */
#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

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

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

/* py_dict_clear.proto */
#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)

/* GetItemInt.proto */
#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 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);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* PyObjectCallNoArg.proto */
#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

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
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);

/* PyDictContains.proto */
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));
}

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
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);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* UnicodeAsUCS4.proto */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);

/* object_ord.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Ord(c)\
    (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
#else
#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
#endif
static long __Pyx__PyObject_Ord(PyObject* c);

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* SliceObject.proto */
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);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* StopAsyncIteration.proto */
#define __Pyx_StopAsyncIteration_USED
static PyObject *__Pyx_PyExc_StopAsyncIteration;
static int __pyx_StopAsyncIteration_init(void);

/* ReturnWithStopIteration.proto */
#define __Pyx_ReturnWithStopIteration(value)\
    if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value)
static void __Pyx__ReturnWithStopIteration(PyObject* value);

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Coroutine.proto */
#define __Pyx_Coroutine_USED
static PyTypeObject *__pyx_CoroutineType = 0;
static PyTypeObject *__pyx_CoroutineAwaitType = 0;
#define __Pyx_Coroutine_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineType)
#define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj)
#define __Pyx_CoroutineAwait_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineAwaitType)
#define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_CoroutineType, body, code, closure, name, qualname, module_name)
static int __pyx_Coroutine_init(void);
static PyObject *__Pyx__Coroutine_await(PyObject *coroutine);
typedef struct {
    PyObject_HEAD
    PyObject *coroutine;
} __pyx_CoroutineAwaitObject;
static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg);
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args);

/* GetAwaitIter.proto */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o);
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o);

/* CoroutineYieldFrom.proto */
static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* IncludeStringH.proto */
#include <string.h>

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* PatchInspect.proto */
static PyObject* __Pyx_patch_inspect(PyObject* module);

/* PatchAsyncIO.proto */
static PyObject* __Pyx_patch_asyncio(PyObject* module);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __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);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__mp_type(enum mp_type value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* IterableCoroutine.proto */
#define __Pyx_IterableCoroutine_USED
static PyTypeObject *__pyx_IterableCoroutineType = 0;
#undef __Pyx_Coroutine_Check
#define __Pyx_Coroutine_Check(obj) (__Pyx_Coroutine_CheckExact(obj) || (Py_TYPE(obj) == __pyx_IterableCoroutineType))
#define __Pyx_IterableCoroutine_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_IterableCoroutineType, body, code, closure, name, qualname, module_name)
static int __pyx_IterableCoroutine_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(struct C_TntFields *__pyx_v_self, uint64_t __pyx_v_id, PyObject *__pyx_v_name); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(struct C_TntFields *__pyx_v_self, int __pyx_v_id); /* proto*/
static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_id_by_name(struct C_TntFields *__pyx_v_self, PyObject *__pyx_v_f); /* proto*/
static CYTHON_INLINE int __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(struct C_TntFields *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11SchemaSpace_add_index(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_f_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self, PyObject *__pyx_v_index, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index *__pyx_optional_args); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_get_space(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_space); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_get_or_create_space(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_space); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_create_dummy_space(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, int __pyx_v_space_id); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_clear(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse_space(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_space_row); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse_index(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_index_row); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse(int64_t __pyx_v_schema_id, PyObject *__pyx_v_spaces, PyObject *__pyx_v_indexes); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(PyObject *__pyx_v_encoding); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__check_readonly(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_len(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_extra_length); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, Py_ssize_t __pyx_v_extra_length); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__reallocate(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_new_size); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_buffer(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, uint64_t __pyx_v_sync, enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op, int64_t __pyx_v_schema_id); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_change_schema_id(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, int64_t __pyx_v_new_schema_id); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_nil(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bool(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, int __pyx_v_value); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_double(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, double __pyx_v_value); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, uint64_t __pyx_v_value); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_int(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, int64_t __pyx_v_value); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_str(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, char const *__pyx_v_str, uint32_t __pyx_v_len); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bin(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, char const *__pyx_v_data, uint32_t __pyx_v_len); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, uint32_t __pyx_v_len); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_map(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, uint32_t __pyx_v_len); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_arr); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_tuple(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_t); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_dict(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_d); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_t, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence *__pyx_optional_args); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_o); /* proto*/
static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_update_ops(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_operations, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_call(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_expression, PyObject *__pyx_v_args); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_select(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, uint64_t __pyx_v_offset, uint64_t __pyx_v_limit, uint32_t __pyx_v_iterator); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key_tuple, PyObject *__pyx_v_operations, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update *__pyx_optional_args); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_operations); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_scramble); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_new(PyObject *__pyx_v_encoding, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new *__pyx_optional_args); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_new_size); /* proto*/
static int __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_extend(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, char const *__pyx_v_data, size_t __pyx_v_len); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_pos); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move_offset(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_offset, size_t __pyx_v_size); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_begin, size_t __pyx_v_end); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_begin(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_begin); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_end(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_end); /* proto*/
static CYTHON_INLINE struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op, uint64_t __pyx_v_sync, int64_t __pyx_v_schema_id, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, int __pyx_v_push_subscribe); /* proto*/
static CYTHON_INLINE int __pyx_f_8asynctnt_6iproto_8protocol_8Response_is_error(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto*/
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_add_push(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_push); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_pop_push(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto*/
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_data(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_exc); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_get_exception(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto*/
static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_notify(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto*/
static CYTHON_INLINE uint32_t __pyx_f_8asynctnt_6iproto_8protocol_8Response__len(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto*/
static CYTHON_INLINE struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_f_8asynctnt_6iproto_8protocol_2Db_new(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_protocol); /* proto*/
static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__ping(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__call16(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__call(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_expression, PyObject *__pyx_v_args, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__select(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, uint64_t __pyx_v_offset, uint64_t __pyx_v_limit, uint32_t __pyx_v_iterator, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t, int __pyx_v_replace, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__update(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, PyObject *__pyx_v_operations, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_operations, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args, int __pyx_v_parse_metadata, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_salt, PyObject *__pyx_v_username, PyObject *__pyx_v_password, float __pyx_v_timeout, int __pyx_v_push_subscribe); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__sha1(PyObject *__pyx_v_values); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__strxor(PyObject *__pyx_v_hash1, PyObject *__pyx_v_scramble); /* proto*/
static int __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__is_connected(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static int __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__is_fully_connected(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__write(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_buf); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_data_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__process__greeting(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_greeting_received(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_response_received(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED char const *__pyx_v_buf, CYTHON_UNUSED uint32_t __pyx_v_buf_len); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_made(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_lost(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__set_connection_ready(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__set_connection_error(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_e); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_greeting_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_response_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, char const *__pyx_v_buf, uint32_t __pyx_v_buf_len); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__do_auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__do_fetch_schema(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_connection_made(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_connection_lost(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* proto*/
static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_next_sync(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__new_waiter_for_request(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req, float __pyx_v_timeout); /* proto*/
static struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__create_db(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_execute(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf, float __pyx_v_timeout); /* proto*/
static uint32_t __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_transform_iterator(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_iterator); /* proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__refetch_schema(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static CYTHON_INLINE struct C_TntFields *__pyx_f_8asynctnt_6iproto_8protocol_7Request_fields(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self); /* proto*/

/* Module declarations from 'cpython.version' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'cpython.exc' */

/* Module declarations from 'cpython.module' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.tuple' */

/* Module declarations from 'cpython.list' */

/* Module declarations from 'cpython.sequence' */

/* Module declarations from 'cpython.mapping' */

/* Module declarations from 'cpython.iterator' */

/* Module declarations from 'cpython.number' */

/* Module declarations from 'cpython.int' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

/* Module declarations from 'cpython.long' */

/* Module declarations from 'cpython.float' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

/* Module declarations from 'cpython.string' */

/* Module declarations from 'cpython.unicode' */

/* Module declarations from 'cpython.dict' */

/* Module declarations from 'cpython.instance' */

/* Module declarations from 'cpython.function' */

/* Module declarations from 'cpython.method' */

/* Module declarations from 'cpython.weakref' */

/* Module declarations from 'cpython.getargs' */

/* Module declarations from 'cpython.pythread' */

/* Module declarations from 'cpython.pystate' */

/* Module declarations from 'cpython.cobject' */

/* Module declarations from 'cpython.oldbuffer' */

/* Module declarations from 'cpython.set' */

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'cpython.bytes' */

/* Module declarations from 'cpython.pycapsule' */

/* Module declarations from 'cpython' */

/* Module declarations from 'asynctnt.iproto.tupleobj' */

/* Module declarations from 'asynctnt.iproto.tarantool' */

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'cython' */

/* Module declarations from 'libc' */

/* Module declarations from 'asynctnt.iproto.protocol' */
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_TntFields = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaIndex = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaDummyIndex = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaDummySpace = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_Schema = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_WriteBuffer = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_ReadBuffer = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_Request = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_Response = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_Db = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_PushIterator = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_CoreProtocol = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol_BaseProtocol = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth = 0;
static PyTypeObject *__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema = 0;
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_decode_string(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_dict_to_list_fields(PyObject *, struct C_TntFields *, int); /*proto*/
static CYTHON_INLINE size_t __pyx_f_8asynctnt_6iproto_8protocol_size_t_max(size_t, size_t); /*proto*/
static CYTHON_INLINE uint32_t __pyx_f_8asynctnt_6iproto_8protocol_nearest_power_of_2(uint32_t); /*proto*/
static Py_ssize_t __pyx_f_8asynctnt_6iproto_8protocol_response_parse_header(char const *, uint32_t, struct __pyx_t_8asynctnt_6iproto_8protocol_Header *); /*proto*/
static Py_ssize_t __pyx_f_8asynctnt_6iproto_8protocol_response_parse_body(char const *, uint32_t, struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, int); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol__decode_obj(char const **, PyObject *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol__response_parse_body_data(char const **, struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_Request__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, PyObject *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_PushIterator__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *, PyObject *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *); /*proto*/
static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "asynctnt.iproto.protocol"
extern int __pyx_module_is_main_asynctnt__iproto__protocol;
int __pyx_module_is_main_asynctnt__iproto__protocol = 0;

/* Implementation of 'asynctnt.iproto.protocol' */
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_BufferError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_UnicodeDecodeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_AttributeError;
static const char __pyx_k_[] = ", ";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_Db[] = "Db";
static const char __pyx_k_EQ[] = "EQ";
static const char __pyx_k_GE[] = "GE";
static const char __pyx_k_GT[] = "GT";
static const char __pyx_k_LE[] = "LE";
static const char __pyx_k_LT[] = "LT";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_02x[] = "{:02x}";
static const char __pyx_k_ALL[] = "ALL";
static const char __pyx_k_REQ[] = "REQ";
static const char __pyx_k__12[] = "";
static const char __pyx_k__16[] = ":";
static const char __pyx_k__32[] = " ... ";
static const char __pyx_k__33[] = "[";
static const char __pyx_k__34[] = "]";
static const char __pyx_k__57[] = ".";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_fut[] = "fut";
static const char __pyx_k_got[] = "{}, got: {}";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_req[] = "_req";
static const char __pyx_k_set[] = "set";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_done[] = "done";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_loop[] = "loop";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_repr[] = "repr";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sha1[] = "sha1";
static const char __pyx_k_sync[] = "sync";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_wait[] = "wait";
static const char __pyx_k_Event[] = "Event";
static const char __pyx_k_anext[] = "__anext__";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_await[] = "__await__";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_deque[] = "deque";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_field[] = "field";
static const char __pyx_k_group[] = "group";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_limit[] = "limit";
static const char __pyx_k_match[] = "match";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_space[] = "space";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_Future[] = "Future";
static const char __pyx_k_Schema[] = "Schema";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_base64[] = "base64";
static const char __pyx_k_cancel[] = "cancel";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_digest[] = "digest";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_family[] = "family";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_gather[] = "gather";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_select[] = "select";
static const char __pyx_k_socket[] = "socket";
static const char __pyx_k_spaces[] = "spaces";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_AF_UNIX[] = "AF_UNIX";
static const char __pyx_k_IntEnum[] = "IntEnum";
static const char __pyx_k_Request[] = "Request";
static const char __pyx_k_asyncio[] = "asyncio";
static const char __pyx_k_closing[] = "_closing";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_futures[] = "futures";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_hashlib[] = "hashlib";
static const char __pyx_k_indexes[] = "indexes";
static const char __pyx_k_inspect[] = "inspect";
static const char __pyx_k_popleft[] = "popleft";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_Iterator[] = "Iterator";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_NEIGHBOR[] = "NEIGHBOR";
static const char __pyx_k_OVERLAPS[] = "OVERLAPS";
static const char __pyx_k_Optional[] = "Optional";
static const char __pyx_k_Protocol[] = "Protocol";
static const char __pyx_k_Response[] = "Response";
static const char __pyx_k_asynctnt[] = "asynctnt";
static const char __pyx_k_encoding[] = "encoding";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_iterator[] = "iterator";
static const char __pyx_k_on_fetch[] = "on_fetch";
static const char __pyx_k_password[] = "password";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_rowcount[] = "rowcount";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_username[] = "username";
static const char __pyx_k_TntFields[] = "<TntFields [{}]>";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_b64decode[] = "b64decode";
static const char __pyx_k_cancelled[] = "cancelled";
static const char __pyx_k_exception[] = "exception";
static const char __pyx_k_func_name[] = "func_name";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_schema_id[] = "schema_id";
static const char __pyx_k_transport[] = "transport";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_ReadBuffer[] = "ReadBuffer";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_call_later[] = "call_later";
static const char __pyx_k_expression[] = "expression";
static const char __pyx_k_memoryview[] = "memoryview";
static const char __pyx_k_operations[] = "operations";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_set_result[] = "set_result";
static const char __pyx_k_setsockopt[] = "setsockopt";
static const char __pyx_k_BufferError[] = "BufferError";
static const char __pyx_k_IPPROTO_TCP[] = "IPPROTO_TCP";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_SchemaIndex[] = "SchemaIndex";
static const char __pyx_k_SchemaSpace[] = "SchemaSpace";
static const char __pyx_k_TCP_NODELAY[] = "TCP_NODELAY";
static const char __pyx_k_TntFields_2[] = "TntFields";
static const char __pyx_k_WriteBuffer[] = "WriteBuffer";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_BITS_ALL_SET[] = "BITS_ALL_SET";
static const char __pyx_k_BITS_ANY_SET[] = "BITS_ANY_SET";
static const char __pyx_k_BaseProtocol[] = "BaseProtocol";
static const char __pyx_k_CoreProtocol[] = "CoreProtocol";
static const char __pyx_k_PushIterator[] = "PushIterator";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_TimeoutError[] = "TimeoutError";
static const char __pyx_k_asynctnt_log[] = "asynctnt.log";
static const char __pyx_k_fetch_schema[] = "fetch_schema";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_Schema_spaces[] = "<Schema spaces={}>";
static const char __pyx_k_asyncio_tasks[] = "asyncio.tasks";
static const char __pyx_k_connected_fut[] = "connected_fut";
static const char __pyx_k_create_future[] = "create_future";
static const char __pyx_k_on_authorized[] = "on_authorized";
static const char __pyx_k_parse_version[] = "_parse_version";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_set_exception[] = "set_exception";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_CancelledError[] = "CancelledError";
static const char __pyx_k_TarantoolTuple[] = "TarantoolTuple";
static const char __pyx_k_get_extra_info[] = "get_extra_info";
static const char __pyx_k_id_name_engine[] = "<{} id={} name={} engine={}>";
static const char __pyx_k_parse_metadata[] = "parse_metadata";
static const char __pyx_k_push_subscribe[] = "push_subscribe";
static const char __pyx_k_Field_not_found[] = "Field '{}' not found";
static const char __pyx_k_Space_not_found[] = "Space {} not found";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_request_timeout[] = "request_timeout";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_BITS_ALL_NOT_SET[] = "BITS_ALL_NOT_SET";
static const char __pyx_k_SchemaDummyIndex[] = "SchemaDummyIndex";
static const char __pyx_k_SchemaDummySpace[] = "SchemaDummySpace";
static const char __pyx_k_exceeded_timeout[] = "{} exceeded timeout";
static const char __pyx_k_sync_d_not_found[] = "sync %d not found";
static const char __pyx_k_add_done_callback[] = "add_done_callback";
static const char __pyx_k_return_exceptions[] = "return_exceptions";
static const char __pyx_k_s_Tarantool_s_d_s[] = "\\s*Tarantool\\s+([\\d.]+)\\s+.*";
static const char __pyx_k_Part_len_must_be_2[] = "Part len must be 2";
static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_hex_locals_genexpr[] = "hex.<locals>.genexpr";
static const char __pyx_k_on_connection_lost[] = "on_connection_lost";
static const char __pyx_k_on_connection_made[] = "on_connection_made";
static const char __pyx_k_on_request_timeout[] = "_on_request_timeout";
static const char __pyx_k_sync_rowcount_data[] = "<{} sync={} rowcount={} data={}>";
static const char __pyx_k_asynctnt_exceptions[] = "asynctnt.exceptions";
static const char __pyx_k_auto_refetch_schema[] = "auto_refetch_schema";
static const char __pyx_k_ConnectionResetError[] = "ConnectionResetError";
static const char __pyx_k_PushIterator___anext[] = "PushIterator.__anext__";
static const char __pyx_k_Schema_fetch_timeout[] = "Schema fetch timeout";
static const char __pyx_k_TarantoolSchemaError[] = "TarantoolSchemaError";
static const char __pyx_k_VERSION_STRING_REGEX[] = "VERSION_STRING_REGEX";
static const char __pyx_k_on_request_completed[] = "_on_request_completed";
static const char __pyx_k_pyx_unpickle_Request[] = "__pyx_unpickle_Request";
static const char __pyx_k_repr___locals_lambda[] = "__repr__.<locals>.<lambda>";
static const char __pyx_k_Unexpected_obj_type_s[] = "Unexpected obj type: %s";
static const char __pyx_k_ConnectionRefusedError[] = "ConnectionRefusedError";
static const char __pyx_k_TarantoolDatabaseError[] = "TarantoolDatabaseError";
static const char __pyx_k_create_future_fallback[] = "_create_future_fallback";
static const char __pyx_k_Space_with_id_not_found[] = "Space with id {} not found";
static const char __pyx_k_sid_id_name_type_unique[] = "<{} sid={}, id={}, name={}, type={}, unique={}>";
static const char __pyx_k_Available_Iterator_types[] = "\n        Available Iterator types\n    ";
static const char __pyx_k_Index_not_found_in_space[] = "Index {} not found in space {}/{}";
static const char __pyx_k_asynctnt_iproto_protocol[] = "asynctnt.iproto.protocol";
static const char __pyx_k_initial_read_buffer_size[] = "initial_read_buffer_size";
static const char __pyx_k_Splice_offset_must_be_int[] = "Splice offset must be int";
static const char __pyx_k_pyx_unpickle_BaseProtocol[] = "__pyx_unpickle_BaseProtocol";
static const char __pyx_k_pyx_unpickle_CoreProtocol[] = "__pyx_unpickle_CoreProtocol";
static const char __pyx_k_pyx_unpickle_PushIterator[] = "__pyx_unpickle_PushIterator";
static const char __pyx_k_unknown_key_in_body_map_d[] = "unknown key in body map: %d";
static const char __pyx_k_TarantoolNotConnectedError[] = "TarantoolNotConnectedError";
static const char __pyx_k_Tarantool_is_not_connected[] = "Tarantool is not connected";
static const char __pyx_k_Splice_position_must_be_int[] = "Splice position must be int";
static const char __pyx_k_code_type_must_be_a_MP_UINT[] = "code type must be a MP_UINT";
static const char __pyx_k_field_name_must_not_be_None[] = "field_name must not be None";
static const char __pyx_k_sync_type_must_be_a_MP_UINT[] = "sync type must be a MP_UINT";
static const char __pyx_k_Header_key_must_be_a_MP_UINT[] = "Header key must be a MP_UINT";
static const char __pyx_k_Lost_connection_to_Tarantool[] = "Lost connection to Tarantool";
static const char __pyx_k_Offset_incorrect_Got_use_len[] = "Offset incorrect. Got: {}. use:{}, len:{}";
static const char __pyx_k_PushIterator___init___line_8[] = "PushIterator.__init__ (line 8)";
static const char __pyx_k_Unexpected_key_type_in_map_s[] = "Unexpected key type in map: %s";
static const char __pyx_k_asynctnt_iproto_protocol_pyx[] = "asynctnt/iproto/protocol.pyx";
static const char __pyx_k_errstr_type_must_be_a_MP_STR[] = "errstr type must be a MP_STR";
static const char __pyx_k_Unknown_update_operation_type[] = "Unknown update operation type `{}`";
static const char __pyx_k_Creates_PushIterator_object_In[] = "\n            Creates PushIterator object. In order to receive push notifications\n            this iterator must be created.\n\n            Example:\n\n            .. code-block:: pycon\n\n                # tarantool function:\n                # function f()\n                #     box.session.push('hello')\n                #     return 'finished'\n                # end\n\n                >>> fut = conn.call('async_function', push_subscribe=True)\n                >>> async for item in PushIterator(fut):\n                ...     print(item)\n\n\n            :param fut: Future object returned from call_async, eval_sync\n                        functions\n            :type fut: asyncio.Future\n        ";
static const char __pyx_k_Lost_connection_to_Tarantool_2[] = "Lost connection to Tarantool: {}: {}";
static const char __pyx_k_Lost_connection_to_Tarantool_3[] = "Lost connection to Tarantool: {}";
static const char __pyx_k_Request_op_sync_schema_id_push[] = "<Request op={} sync={} schema_id={} push_subscribe={}>";
static const char __pyx_k_Response_body_must_be_a_MP_MAP[] = "Response body must be a MP_MAP";
static const char __pyx_k_BaseProtocol__do_auth_locals_on[] = "BaseProtocol._do_auth.<locals>.on_authorized";
static const char __pyx_k_Field_map_must_contain_at_least[] = "Field map must contain at least 1 element - field_name";
static const char __pyx_k_Index_must_be_either_str_or_int[] = "Index must be either str or int, got: {}";
static const char __pyx_k_Iterator_is_of_unsupported_type[] = "Iterator is of unsupported type (asynctnt.Iterator, int, str)";
static const char __pyx_k_Operation_type_must_of_a_str_or[] = "Operation type must of a str or bytes type";
static const char __pyx_k_Space_must_be_either_str_or_int[] = "Space must be either str or int, got: {}";
static const char __pyx_k_on_data_received_expected_bytes[] = "_on_data_received: expected bytes object";
static const char __pyx_k_sequence_must_be_either_list_or[] = "sequence must be either list or tuple";
static const char __pyx_k_the_buffer_is_in_read_only_mode[] = "the buffer is in read-only mode";
static const char __pyx_k_BaseProtocol__do_fetch_schema_lo[] = "BaseProtocol._do_fetch_schema.<locals>.on_fetch";
static const char __pyx_k_Cannot_pop_push_from_a_non_async[] = "Cannot pop push from a non-async response";
static const char __pyx_k_Cannot_use_iter_with_PushIterato[] = "Cannot use iter with PushIterator - use aiter";
static const char __pyx_k_Cannot_use_next_with_PushIterato[] = "Cannot use next with PushIterator - use anext";
static const char __pyx_k_Deallocating_buffer_with_attache[] = "Deallocating buffer with attached memoryviews";
static const char __pyx_k_Error_happened_while_parsing_sch[] = "Error happened while parsing schema. Space, fields and index names currently not working. Please file an issue at https://github.com/igorcoding/asynctnt";
static const char __pyx_k_Field_d_of_space_s_is_not_in_spa[] = "Field #%d of space %s is not in space format definition";
static const char __pyx_k_Field_s_in_supplied_dict_is_unkn[] = "Field '%s' in supplied dict is unknown as a tuple field for selected index. Skipping.";
static const char __pyx_k_Future_is_invalid_Make_sure_to_c[] = "Future is invalid. Make sure to call with a future returned from a method with push_subscribe=True flag";
static const char __pyx_k_Impossible_condition_happened_Pl[] = "Impossible condition happened. Please file a bug to https://github.com/igorcoding/asynctnt";
static const char __pyx_k_Incompatible_checksums_s_vs_0x01[] = "Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x1c[] = "Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xd6[] = "Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xf1[] = "Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))";
static const char __pyx_k_Index_s_not_found_in_space_s_s_C[] = "Index %s not found in space %s/%s. Creating dummy.";
static const char __pyx_k_Operation_field_no_must_be_int_a[] = "Operation field_no must be int as there is no format declaration in space {}";
static const char __pyx_k_Operation_field_no_must_be_of_ei[] = "Operation field_no must be of either int or str type";
static const char __pyx_k_Operation_length_must_be_at_leas[] = "Operation length must be at least 3";
static const char __pyx_k_Response_header_must_be_a_MP_MAP[] = "Response header must be a MP_MAP";
static const char __pyx_k_Single_operation_must_be_a_tuple[] = "Single operation must be a tuple or list";
static const char __pyx_k_Space_s_not_found_Creating_dummy[] = "Space %s not found. Creating dummy.";
static const char __pyx_k_Splice_operation_must_have_lengt[] = "Splice operation must have length of 5, but got: {}";
static const char __pyx_k_Tarantool_s_s_Authorization_fail[] = "Tarantool[%s:%s] Authorization failed: %s";
static const char __pyx_k_Tarantool_s_s_Authorized_success[] = "Tarantool[%s:%s] Authorized successfully";
static const char __pyx_k_Tarantool_s_s_Schema_fetch_faile[] = "Tarantool[%s:%s] Schema fetch failed: %s";
static const char __pyx_k_Tarantool_s_s_Schema_fetch_succe[] = "Tarantool[%s:%s] Schema fetch succeeded. Version: %d, Spaces: %d, Indexes: %d.";
static const char __pyx_k_Tuple_must_be_an_array_when_deco[] = "Tuple must be an array when decoding as TarantoolTuple";
static const char __pyx_k_Type_is_not_supported_for_encodi[] = "Type `{}` is not supported for encoding";
static const char __pyx_k_Unknown_key_with_code_d_in_heade[] = "Unknown key with code '%d' in header. Skipping.";
static const char __pyx_k_body_data_type_must_be_a_MP_ARRA[] = "body data type must be a MP_ARRAY";
static const char __pyx_k_encoding_must_be_either_str_or_b[] = "encoding must be either str or bytes";
static const char __pyx_k_int_argument_required_for_Arithm[] = "int argument required for Arithmetic and Delete operations";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_schema_id_type_must_be_a_MP_UINT[] = "schema_id type must be a MP_UINT";
static const char __pyx_k_sequence_must_be_either_list_tup[] = "sequence must be either list, tuple or dict";
static const char __pyx_k_unknown_key_in_metadata_decoding[] = "unknown key in metadata decoding: %d";
static const char __pyx_k_unknown_key_in_sql_info_decoding[] = "unknown key in sql info decoding: %d";
static const char __pyx_k_Field_map_must_contain_at_least_2[] = "Field map must contain at least 1 element - rowcount";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_kp_u_02x;
static PyObject *__pyx_n_s_AF_UNIX;
static PyObject *__pyx_n_u_AF_UNIX;
static PyObject *__pyx_n_s_ALL;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_s_Available_Iterator_types;
static PyObject *__pyx_n_s_BITS_ALL_NOT_SET;
static PyObject *__pyx_n_s_BITS_ALL_SET;
static PyObject *__pyx_n_s_BITS_ANY_SET;
static PyObject *__pyx_n_s_BaseProtocol;
static PyObject *__pyx_n_s_BaseProtocol__do_auth_locals_on;
static PyObject *__pyx_n_s_BaseProtocol__do_fetch_schema_lo;
static PyObject *__pyx_n_s_BufferError;
static PyObject *__pyx_n_s_CancelledError;
static PyObject *__pyx_kp_u_Cannot_pop_push_from_a_non_async;
static PyObject *__pyx_kp_u_Cannot_use_iter_with_PushIterato;
static PyObject *__pyx_kp_u_Cannot_use_next_with_PushIterato;
static PyObject *__pyx_n_s_ConnectionRefusedError;
static PyObject *__pyx_n_s_ConnectionResetError;
static PyObject *__pyx_n_s_CoreProtocol;
static PyObject *__pyx_kp_u_Creates_PushIterator_object_In;
static PyObject *__pyx_n_s_Db;
static PyObject *__pyx_kp_u_Deallocating_buffer_with_attache;
static PyObject *__pyx_n_s_EQ;
static PyObject *__pyx_kp_u_Error_happened_while_parsing_sch;
static PyObject *__pyx_n_s_Event;
static PyObject *__pyx_kp_u_Field_d_of_space_s_is_not_in_spa;
static PyObject *__pyx_kp_u_Field_map_must_contain_at_least;
static PyObject *__pyx_kp_u_Field_map_must_contain_at_least_2;
static PyObject *__pyx_kp_u_Field_not_found;
static PyObject *__pyx_kp_u_Field_s_in_supplied_dict_is_unkn;
static PyObject *__pyx_n_s_Future;
static PyObject *__pyx_kp_u_Future_is_invalid_Make_sure_to_c;
static PyObject *__pyx_n_s_GE;
static PyObject *__pyx_n_s_GT;
static PyObject *__pyx_kp_u_Header_key_must_be_a_MP_UINT;
static PyObject *__pyx_n_s_IPPROTO_TCP;
static PyObject *__pyx_kp_u_Impossible_condition_happened_Pl;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x01;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x1c;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd6;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf1;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_u_Index_must_be_either_str_or_int;
static PyObject *__pyx_kp_u_Index_not_found_in_space;
static PyObject *__pyx_kp_u_Index_s_not_found_in_space_s_s_C;
static PyObject *__pyx_n_s_IntEnum;
static PyObject *__pyx_n_s_Iterator;
static PyObject *__pyx_kp_u_Iterator_is_of_unsupported_type;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_LE;
static PyObject *__pyx_n_s_LT;
static PyObject *__pyx_kp_u_Lost_connection_to_Tarantool;
static PyObject *__pyx_kp_u_Lost_connection_to_Tarantool_2;
static PyObject *__pyx_kp_u_Lost_connection_to_Tarantool_3;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_n_s_NEIGHBOR;
static PyObject *__pyx_n_s_OVERLAPS;
static PyObject *__pyx_kp_u_Offset_incorrect_Got_use_len;
static PyObject *__pyx_kp_u_Operation_field_no_must_be_int_a;
static PyObject *__pyx_kp_u_Operation_field_no_must_be_of_ei;
static PyObject *__pyx_kp_u_Operation_length_must_be_at_leas;
static PyObject *__pyx_kp_u_Operation_type_must_of_a_str_or;
static PyObject *__pyx_n_s_Optional;
static PyObject *__pyx_kp_u_Part_len_must_be_2;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_n_s_Protocol;
static PyObject *__pyx_n_s_PushIterator;
static PyObject *__pyx_n_s_PushIterator___anext;
static PyObject *__pyx_kp_u_PushIterator___init___line_8;
static PyObject *__pyx_n_s_REQ;
static PyObject *__pyx_n_s_ReadBuffer;
static PyObject *__pyx_n_s_Request;
static PyObject *__pyx_kp_u_Request_op_sync_schema_id_push;
static PyObject *__pyx_n_s_Response;
static PyObject *__pyx_kp_u_Response_body_must_be_a_MP_MAP;
static PyObject *__pyx_kp_u_Response_header_must_be_a_MP_MAP;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_Schema;
static PyObject *__pyx_n_s_SchemaDummyIndex;
static PyObject *__pyx_n_s_SchemaDummySpace;
static PyObject *__pyx_n_s_SchemaIndex;
static PyObject *__pyx_n_s_SchemaSpace;
static PyObject *__pyx_kp_u_Schema_fetch_timeout;
static PyObject *__pyx_kp_u_Schema_spaces;
static PyObject *__pyx_kp_u_Single_operation_must_be_a_tuple;
static PyObject *__pyx_kp_u_Space_must_be_either_str_or_int;
static PyObject *__pyx_kp_u_Space_not_found;
static PyObject *__pyx_kp_u_Space_s_not_found_Creating_dummy;
static PyObject *__pyx_kp_u_Space_with_id_not_found;
static PyObject *__pyx_kp_u_Splice_offset_must_be_int;
static PyObject *__pyx_kp_u_Splice_operation_must_have_lengt;
static PyObject *__pyx_kp_u_Splice_position_must_be_int;
static PyObject *__pyx_n_s_TCP_NODELAY;
static PyObject *__pyx_n_s_TarantoolDatabaseError;
static PyObject *__pyx_n_s_TarantoolNotConnectedError;
static PyObject *__pyx_n_s_TarantoolSchemaError;
static PyObject *__pyx_n_s_TarantoolTuple;
static PyObject *__pyx_kp_u_Tarantool_is_not_connected;
static PyObject *__pyx_kp_u_Tarantool_s_s_Authorization_fail;
static PyObject *__pyx_kp_u_Tarantool_s_s_Authorized_success;
static PyObject *__pyx_kp_u_Tarantool_s_s_Schema_fetch_faile;
static PyObject *__pyx_kp_u_Tarantool_s_s_Schema_fetch_succe;
static PyObject *__pyx_n_s_TimeoutError;
static PyObject *__pyx_kp_u_TntFields;
static PyObject *__pyx_n_s_TntFields_2;
static PyObject *__pyx_kp_u_Tuple_must_be_an_array_when_deco;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_u_Type_is_not_supported_for_encodi;
static PyObject *__pyx_kp_u_Unexpected_key_type_in_map_s;
static PyObject *__pyx_kp_u_Unexpected_obj_type_s;
static PyObject *__pyx_n_s_UnicodeDecodeError;
static PyObject *__pyx_kp_u_Unknown_key_with_code_d_in_heade;
static PyObject *__pyx_kp_u_Unknown_update_operation_type;
static PyObject *__pyx_n_s_VERSION_STRING_REGEX;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_WriteBuffer;
static PyObject *__pyx_kp_u__12;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_kp_u__34;
static PyObject *__pyx_kp_u__57;
static PyObject *__pyx_n_s_add_done_callback;
static PyObject *__pyx_n_s_anext;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_u_ascii;
static PyObject *__pyx_n_s_asyncio;
static PyObject *__pyx_n_s_asyncio_coroutines;
static PyObject *__pyx_n_s_asyncio_tasks;
static PyObject *__pyx_n_s_asynctnt;
static PyObject *__pyx_n_s_asynctnt_exceptions;
static PyObject *__pyx_n_s_asynctnt_iproto_protocol;
static PyObject *__pyx_kp_s_asynctnt_iproto_protocol_pyx;
static PyObject *__pyx_n_s_asynctnt_log;
static PyObject *__pyx_n_s_auto_refetch_schema;
static PyObject *__pyx_n_s_await;
static PyObject *__pyx_n_s_b64decode;
static PyObject *__pyx_n_s_base64;
static PyObject *__pyx_kp_u_body_data_type_must_be_a_MP_ARRA;
static PyObject *__pyx_n_s_call_later;
static PyObject *__pyx_n_s_cancel;
static PyObject *__pyx_n_s_cancelled;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closing;
static PyObject *__pyx_kp_u_code_type_must_be_a_MP_UINT;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_connected_fut;
static PyObject *__pyx_n_s_create_future;
static PyObject *__pyx_n_s_create_future_fallback;
static PyObject *__pyx_n_s_debug;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_deque;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_digest;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_done;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_encoding;
static PyObject *__pyx_kp_u_encoding_must_be_either_str_or_b;
static PyObject *__pyx_n_s_enum;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_kp_u_errstr_type_must_be_a_MP_STR;
static PyObject *__pyx_kp_u_exceeded_timeout;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_n_s_expression;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_family;
static PyObject *__pyx_n_s_fetch_schema;
static PyObject *__pyx_n_u_field;
static PyObject *__pyx_kp_u_field_name_must_not_be_None;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_func_name;
static PyObject *__pyx_n_s_fut;
static PyObject *__pyx_n_s_futures;
static PyObject *__pyx_n_s_gather;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get_extra_info;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_kp_u_got;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_s_hashlib;
static PyObject *__pyx_n_s_hex_locals_genexpr;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_kp_u_id_name_engine;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_indexes;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_initial_read_buffer_size;
static PyObject *__pyx_n_s_inspect;
static PyObject *__pyx_kp_u_int_argument_required_for_Arithm;
static PyObject *__pyx_n_s_iterator;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_limit;
static PyObject *__pyx_n_s_logger;
static PyObject *__pyx_n_s_loop;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_memoryview;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name_2;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_on_authorized;
static PyObject *__pyx_n_s_on_connection_lost;
static PyObject *__pyx_n_s_on_connection_made;
static PyObject *__pyx_kp_u_on_data_received_expected_bytes;
static PyObject *__pyx_n_s_on_fetch;
static PyObject *__pyx_n_s_on_request_completed;
static PyObject *__pyx_n_s_on_request_timeout;
static PyObject *__pyx_n_s_operations;
static PyObject *__pyx_n_s_parse_metadata;
static PyObject *__pyx_n_s_parse_version;
static PyObject *__pyx_n_s_password;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_popleft;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_push_subscribe;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_BaseProtocol;
static PyObject *__pyx_n_s_pyx_unpickle_CoreProtocol;
static PyObject *__pyx_n_s_pyx_unpickle_PushIterator;
static PyObject *__pyx_n_s_pyx_unpickle_Request;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_query;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_repr___locals_lambda;
static PyObject *__pyx_n_s_req;
static PyObject *__pyx_n_u_req;
static PyObject *__pyx_n_s_request_timeout;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_return_exceptions;
static PyObject *__pyx_n_s_rowcount;
static PyObject *__pyx_kp_u_s_Tarantool_s_d_s;
static PyObject *__pyx_n_s_schema_id;
static PyObject *__pyx_kp_u_schema_id_type_must_be_a_MP_UINT;
static PyObject *__pyx_n_s_select;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_kp_u_sequence_must_be_either_list_or;
static PyObject *__pyx_kp_u_sequence_must_be_either_list_tup;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_set_exception;
static PyObject *__pyx_n_s_set_result;
static PyObject *__pyx_n_s_setsockopt;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_sha1;
static PyObject *__pyx_kp_u_sid_id_name_type_unique;
static PyObject *__pyx_n_s_socket;
static PyObject *__pyx_n_u_socket;
static PyObject *__pyx_n_s_space;
static PyObject *__pyx_n_s_spaces;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_sync;
static PyObject *__pyx_kp_u_sync_d_not_found;
static PyObject *__pyx_kp_u_sync_rowcount_data;
static PyObject *__pyx_kp_u_sync_type_must_be_a_MP_UINT;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_kp_u_the_buffer_is_in_read_only_mode;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_transport;
static PyObject *__pyx_n_u_type;
static PyObject *__pyx_n_s_typing;
static PyObject *__pyx_kp_u_unknown_key_in_body_map_d;
static PyObject *__pyx_kp_u_unknown_key_in_metadata_decoding;
static PyObject *__pyx_kp_u_unknown_key_in_sql_info_decoding;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_username;
static PyObject *__pyx_kp_b_utf_8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_wait;
static PyObject *__pyx_n_s_warning;
static PyObject *__pyx_n_s_write;
static int __pyx_pf_8asynctnt_6iproto_8protocol_9TntFields___cinit__(struct C_TntFields *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_2__repr__(struct C_TntFields *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_4__reduce_cython__(CYTHON_UNUSED struct C_TntFields *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_6__setstate_cython__(CYTHON_UNUSED struct C_TntFields *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummyIndex___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummySpace___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummySpace_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_6Schema___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, int64_t __pyx_v_schema_id); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6Schema_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6Schema_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6Schema_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto */
static void __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_2__dealloc__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_4__getbuffer__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /* proto */
static void __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_6__releasebuffer__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_3hex_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_8hex(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self); /* proto */
static void __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_2__dealloc__(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_7Request___repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_7Request_2__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_7Request_4__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_8Response___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_encoding, int __pyx_v_push_subscribe); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_4sync___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_4code___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_11return_code___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_9schema_id___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_6errmsg___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_4body___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_8encoding___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_8rowcount___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_17autoincrement_ids___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_4done(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_8asynctnt_6iproto_8protocol_8Response_6__len__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_8__getitem__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_10__iter__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_2_q___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_11_push_event___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_2Db___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_2ping(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_4call16(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, PyObject *__pyx_v_timeout, PyObject *__pyx_v_push_subscribe); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_6call(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, PyObject *__pyx_v_timeout, PyObject *__pyx_v_push_subscribe); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_8eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_expression, PyObject *__pyx_v_args, PyObject *__pyx_v_timeout, PyObject *__pyx_v_push_subscribe); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_10select(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_offset, PyObject *__pyx_v_limit, PyObject *__pyx_v_index, PyObject *__pyx_v_iterator, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_12insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_replace, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_14replace(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_16delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_index, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_18update(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_operations, PyObject *__pyx_v_index, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_20upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_operations, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_22sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args, PyObject *__pyx_v_parse_metadata, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator___init__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self, PyObject *__pyx_v_fut); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_2__iter__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_4__next__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_6__aiter__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_8__anext__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_8response___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_11__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_13__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol___init__(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_encoding, PyObject *__pyx_v_initial_read_buffer_size); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_2is_connected(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_4is_fully_connected(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_6get_version(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_8_parse_version(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_version); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_10data_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_12connection_made(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_transport); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_14connection_lost(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_16__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_18__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol___init__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_username, PyObject *__pyx_v_password, PyObject *__pyx_v_fetch_schema, PyObject *__pyx_v_auto_refetch_schema, PyObject *__pyx_v_connected_fut, PyObject *__pyx_v_on_connection_made, PyObject *__pyx_v_on_connection_lost, PyObject *__pyx_v_loop, PyObject *__pyx_v_request_timeout, PyObject *__pyx_v_encoding, PyObject *__pyx_v_initial_read_buffer_size); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_2_create_future_fallback(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_6schema___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_9schema_id___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_on_authorized(PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_on_fetch(PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_4_on_request_timeout(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_6_on_request_completed(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_8create_db(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_10get_common_db(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_12refetch_schema(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_14__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_16__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol___pyx_unpickle_Request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2__pyx_unpickle_PushIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_4__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummyIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaSpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummySpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Schema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_WriteBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_ReadBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Request(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Response(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Db(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_PushIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_CoreProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_BaseProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_281;
static PyObject *__pyx_int_289;
static PyObject *__pyx_int_2045263;
static PyObject *__pyx_int_29796805;
static PyObject *__pyx_int_225261924;
static PyObject *__pyx_int_253265777;
static PyObject *__pyx_int_4294967295;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_2;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__30;
static PyObject *__pyx_slice__31;
static PyObject *__pyx_slice__56;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__17;
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;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
/* Late includes */

/* "asynctnt/iproto/unicodeutil.pyx":5
 * 
 * 
 * cdef bytes encode_unicode_string(object s, bytes encoding):             # <<<<<<<<<<<<<<
 *     cdef:
 *         bytes b
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(PyObject *__pyx_v_s, PyObject *__pyx_v_encoding) {
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  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("encode_unicode_string", 0);

  /* "asynctnt/iproto/unicodeutil.pyx":11
 * 
 *     b = <bytes><object>cpython.unicode.PyUnicode_AsEncodedString(
 *         s, encoding, b'strict'             # <<<<<<<<<<<<<<
 *     )
 *     return b
 */
  if (unlikely(__pyx_v_encoding == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(6, 11, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(6, 11, __pyx_L1_error)

  /* "asynctnt/iproto/unicodeutil.pyx":10
 *         PyObject *p
 * 
 *     b = <bytes><object>cpython.unicode.PyUnicode_AsEncodedString(             # <<<<<<<<<<<<<<
 *         s, encoding, b'strict'
 *     )
 */
  __pyx_t_2 = PyUnicode_AsEncodedString(__pyx_v_s, __pyx_t_1, ((char *)"strict")); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_b = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asynctnt/iproto/unicodeutil.pyx":13
 *         s, encoding, b'strict'
 *     )
 *     return b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_b);
  __pyx_r = __pyx_v_b;
  goto __pyx_L0;

  /* "asynctnt/iproto/unicodeutil.pyx":5
 * 
 * 
 * cdef bytes encode_unicode_string(object s, bytes encoding):             # <<<<<<<<<<<<<<
 *     cdef:
 *         bytes b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.encode_unicode_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/unicodeutil.pyx":16
 * 
 * 
 * cdef str decode_string(bytes b, bytes encoding):             # <<<<<<<<<<<<<<
 *     return <str><object>cpython.unicode.PyUnicode_FromEncodedObject(
 *         b, encoding, b'strict'
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_decode_string(PyObject *__pyx_v_b, PyObject *__pyx_v_encoding) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_string", 0);

  /* "asynctnt/iproto/unicodeutil.pyx":17
 * 
 * cdef str decode_string(bytes b, bytes encoding):
 *     return <str><object>cpython.unicode.PyUnicode_FromEncodedObject(             # <<<<<<<<<<<<<<
 *         b, encoding, b'strict'
 *     )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/unicodeutil.pyx":18
 * cdef str decode_string(bytes b, bytes encoding):
 *     return <str><object>cpython.unicode.PyUnicode_FromEncodedObject(
 *         b, encoding, b'strict'             # <<<<<<<<<<<<<<
 *     )
 */
  if (unlikely(__pyx_v_encoding == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(6, 18, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(6, 18, __pyx_L1_error)

  /* "asynctnt/iproto/unicodeutil.pyx":17
 * 
 * cdef str decode_string(bytes b, bytes encoding):
 *     return <str><object>cpython.unicode.PyUnicode_FromEncodedObject(             # <<<<<<<<<<<<<<
 *         b, encoding, b'strict'
 *     )
 */
  __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_b, __pyx_t_1, ((char *)"strict")); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject*)((PyObject *)__pyx_t_2)));
  __pyx_r = ((PyObject*)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/unicodeutil.pyx":16
 * 
 * 
 * cdef str decode_string(bytes b, bytes encoding):             # <<<<<<<<<<<<<<
 *     return <str><object>cpython.unicode.PyUnicode_FromEncodedObject(
 *         b, encoding, b'strict'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.decode_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":15
 * @cython.freelist(TNT_FIELDS_FREELIST_SIZE)
 * cdef public class TntFields [object C_TntFields, type C_TntFields_Type]:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._names = []
 *         self._mapping = {}
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_9TntFields___cinit__(((struct C_TntFields *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/schema.pyx":16
 * cdef public class TntFields [object C_TntFields, type C_TntFields_Type]:
 *     def __cinit__(self):
 *         self._names = []             # <<<<<<<<<<<<<<
 *         self._mapping = {}
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_names);
  __Pyx_DECREF(__pyx_v_self->_names);
  __pyx_v_self->_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":17
 *     def __cinit__(self):
 *         self._names = []
 *         self._mapping = {}             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void add(self, uint64_t id, str name):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_mapping);
  __Pyx_DECREF(__pyx_v_self->_mapping);
  __pyx_v_self->_mapping = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":15
 * @cython.freelist(TNT_FIELDS_FREELIST_SIZE)
 * cdef public class TntFields [object C_TntFields, type C_TntFields_Type]:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._names = []
 *         self._mapping = {}
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.TntFields.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":19
 *         self._mapping = {}
 * 
 *     cdef inline void add(self, uint64_t id, str name):             # <<<<<<<<<<<<<<
 *         self._names.append(name)
 *         self._mapping[name] = id
 */

static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(struct C_TntFields *__pyx_v_self, uint64_t __pyx_v_id, PyObject *__pyx_v_name) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "asynctnt/iproto/schema.pyx":20
 * 
 *     cdef inline void add(self, uint64_t id, str name):
 *         self._names.append(name)             # <<<<<<<<<<<<<<
 *         self._mapping[name] = id
 * 
 */
  if (unlikely(__pyx_v_self->_names == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 20, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_names, __pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 20, __pyx_L1_error)

  /* "asynctnt/iproto/schema.pyx":21
 *     cdef inline void add(self, uint64_t id, str name):
 *         self._names.append(name)
 *         self._mapping[name] = id             # <<<<<<<<<<<<<<
 * 
 *     cdef inline str name_by_id(self, int id):
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_v_self->_mapping == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 21, __pyx_L1_error)
  }
  if (unlikely(PyDict_SetItem(__pyx_v_self->_mapping, __pyx_v_name, __pyx_t_2) < 0)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":19
 *         self._mapping = {}
 * 
 *     cdef inline void add(self, uint64_t id, str name):             # <<<<<<<<<<<<<<
 *         self._names.append(name)
 *         self._mapping[name] = id
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.TntFields.add", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/schema.pyx":23
 *         self._mapping[name] = id
 * 
 *     cdef inline str name_by_id(self, int id):             # <<<<<<<<<<<<<<
 *         return <str>cpython.list.PyList_GetItem(self._names, id)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(struct C_TntFields *__pyx_v_self, int __pyx_v_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name_by_id", 0);

  /* "asynctnt/iproto/schema.pyx":24
 * 
 *     cdef inline str name_by_id(self, int id):
 *         return <str>cpython.list.PyList_GetItem(self._names, id)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline uint64_t id_by_name(self, str f) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_names;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyList_GetItem(__pyx_t_1, __pyx_v_id); if (unlikely(__pyx_t_2 == ((PyObject *)NULL))) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(((PyObject*)__pyx_t_2));
  __pyx_r = ((PyObject*)__pyx_t_2);
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":23
 *         self._mapping[name] = id
 * 
 *     cdef inline str name_by_id(self, int id):             # <<<<<<<<<<<<<<
 *         return <str>cpython.list.PyList_GetItem(self._names, id)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.TntFields.name_by_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":26
 *         return <str>cpython.list.PyList_GetItem(self._names, id)
 * 
 *     cdef inline uint64_t id_by_name(self, str f) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject *fld
 */

static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_id_by_name(struct C_TntFields *__pyx_v_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_v_fld;
  uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  uint64_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("id_by_name", 0);

  /* "asynctnt/iproto/schema.pyx":30
 *             PyObject *fld
 * 
 *         fld = cpython.dict.PyDict_GetItem(self._mapping, f)             # <<<<<<<<<<<<<<
 *         if fld == NULL:
 *             raise KeyError('Field \'{}\' not found'.format(f))
 */
  __pyx_t_1 = __pyx_v_self->_mapping;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fld = PyDict_GetItem(__pyx_t_1, __pyx_v_f);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":31
 * 
 *         fld = cpython.dict.PyDict_GetItem(self._mapping, f)
 *         if fld == NULL:             # <<<<<<<<<<<<<<
 *             raise KeyError('Field \'{}\' not found'.format(f))
 *         return <uint64_t><object>fld
 */
  __pyx_t_2 = ((__pyx_v_fld == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "asynctnt/iproto/schema.pyx":32
 *         fld = cpython.dict.PyDict_GetItem(self._mapping, f)
 *         if fld == NULL:
 *             raise KeyError('Field \'{}\' not found'.format(f))             # <<<<<<<<<<<<<<
 *         return <uint64_t><object>fld
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Field_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_f) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_f);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 32, __pyx_L1_error)

    /* "asynctnt/iproto/schema.pyx":31
 * 
 *         fld = cpython.dict.PyDict_GetItem(self._mapping, f)
 *         if fld == NULL:             # <<<<<<<<<<<<<<
 *             raise KeyError('Field \'{}\' not found'.format(f))
 *         return <uint64_t><object>fld
 */
  }

  /* "asynctnt/iproto/schema.pyx":33
 *         if fld == NULL:
 *             raise KeyError('Field \'{}\' not found'.format(f))
 *         return <uint64_t><object>fld             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int len(self):
 */
  __pyx_t_5 = __Pyx_PyInt_As_uint64_t(((PyObject *)__pyx_v_fld)); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
  __pyx_r = ((uint64_t)__pyx_t_5);
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":26
 *         return <str>cpython.list.PyList_GetItem(self._names, id)
 * 
 *     cdef inline uint64_t id_by_name(self, str f) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject *fld
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.TntFields.id_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":35
 *         return <uint64_t><object>fld
 * 
 *     cdef inline int len(self):             # <<<<<<<<<<<<<<
 *         return <int>cpython.list.PyList_GET_SIZE(self._names)
 * 
 */

static CYTHON_INLINE int __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(struct C_TntFields *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("len", 0);

  /* "asynctnt/iproto/schema.pyx":36
 * 
 *     cdef inline int len(self):
 *         return <int>cpython.list.PyList_GET_SIZE(self._names)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_v_self->_names;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_r = ((int)PyList_GET_SIZE(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":35
 *         return <uint64_t><object>fld
 * 
 *     cdef inline int len(self):             # <<<<<<<<<<<<<<
 *         return <int>cpython.list.PyList_GET_SIZE(self._names)
 * 
 */

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

/* "asynctnt/iproto/schema.pyx":38
 *         return <int>cpython.list.PyList_GET_SIZE(self._names)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<TntFields [{}]>'.format(', '.join(self._names))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_2__repr__(((struct C_TntFields *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_2__repr__(struct C_TntFields *__pyx_v_self) {
  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("__repr__", 0);

  /* "asynctnt/iproto/schema.pyx":39
 * 
 *     def __repr__(self):
 *         return '<TntFields [{}]>'.format(', '.join(self._names))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_TntFields, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->_names;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":38
 *         return <int>cpython.list.PyList_GET_SIZE(self._names)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<TntFields [{}]>'.format(', '.join(self._names))
 * 
 */

  /* function exit code */
  __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("asynctnt.iproto.protocol.TntFields.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_4__reduce_cython__(((struct C_TntFields *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_4__reduce_cython__(CYTHON_UNUSED struct C_TntFields *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.TntFields.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_6__setstate_cython__(((struct C_TntFields *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_9TntFields_6__setstate_cython__(CYTHON_UNUSED struct C_TntFields *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.TntFields.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":43
 * 
 * cdef class SchemaIndex:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.iid = -1
 *         self.sid = -1
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_v_self));

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asynctnt/iproto/schema.pyx":44
 * cdef class SchemaIndex:
 *     def __cinit__(self):
 *         self.iid = -1             # <<<<<<<<<<<<<<
 *         self.sid = -1
 *         self.name = None
 */
  __pyx_v_self->iid = -1;

  /* "asynctnt/iproto/schema.pyx":45
 *     def __cinit__(self):
 *         self.iid = -1
 *         self.sid = -1             # <<<<<<<<<<<<<<
 *         self.name = None
 *         self.index_type = None
 */
  __pyx_v_self->sid = -1;

  /* "asynctnt/iproto/schema.pyx":46
 *         self.iid = -1
 *         self.sid = -1
 *         self.name = None             # <<<<<<<<<<<<<<
 *         self.index_type = None
 *         self.unique = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* "asynctnt/iproto/schema.pyx":47
 *         self.sid = -1
 *         self.name = None
 *         self.index_type = None             # <<<<<<<<<<<<<<
 *         self.unique = None
 *         self.fields = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->index_type);
  __Pyx_DECREF(__pyx_v_self->index_type);
  __pyx_v_self->index_type = ((PyObject*)Py_None);

  /* "asynctnt/iproto/schema.pyx":48
 *         self.name = None
 *         self.index_type = None
 *         self.unique = None             # <<<<<<<<<<<<<<
 *         self.fields = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->unique);
  __Pyx_DECREF(__pyx_v_self->unique);
  __pyx_v_self->unique = Py_None;

  /* "asynctnt/iproto/schema.pyx":49
 *         self.index_type = None
 *         self.unique = None
 *         self.fields = None             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fields);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->fields));
  __pyx_v_self->fields = ((struct C_TntFields *)Py_None);

  /* "asynctnt/iproto/schema.pyx":43
 * 
 * cdef class SchemaIndex:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.iid = -1
 *         self.sid = -1
 */

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

/* "asynctnt/iproto/schema.pyx":51
 *         self.fields = None
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return \
 *             '<{} sid={}, id={}, name={}, ' \
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_2__repr__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self) {
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "asynctnt/iproto/schema.pyx":52
 * 
 *     def __repr__(self):
 *         return \             # <<<<<<<<<<<<<<
 *             '<{} sid={}, id={}, name={}, ' \
 *             'type={}, unique={}>'.format(
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/schema.pyx":54
 *         return \
 *             '<{} sid={}, id={}, name={}, ' \
 *             'type={}, unique={}>'.format(             # <<<<<<<<<<<<<<
 *                 self.__class__.__name__,
 *                 self.sid, self.iid, self.name, self.index_type, self.unique
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_sid_id_name_type_unique, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/schema.pyx":55
 *             '<{} sid={}, id={}, name={}, ' \
 *             'type={}, unique={}>'.format(
 *                 self.__class__.__name__,             # <<<<<<<<<<<<<<
 *                 self.sid, self.iid, self.name, self.index_type, self.unique
 *             )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asynctnt/iproto/schema.pyx":56
 *             'type={}, unique={}>'.format(
 *                 self.__class__.__name__,
 *                 self.sid, self.iid, self.name, self.index_type, self.unique             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->sid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->iid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[7] = {__pyx_t_6, __pyx_t_4, __pyx_t_3, __pyx_t_5, __pyx_v_self->name, __pyx_v_self->index_type, __pyx_v_self->unique};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[7] = {__pyx_t_6, __pyx_t_4, __pyx_t_3, __pyx_t_5, __pyx_v_self->name, __pyx_v_self->index_type, __pyx_v_self->unique};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->name);
    __Pyx_GIVEREF(__pyx_v_self->name);
    PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_self->name);
    __Pyx_INCREF(__pyx_v_self->index_type);
    __Pyx_GIVEREF(__pyx_v_self->index_type);
    PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_v_self->index_type);
    __Pyx_INCREF(__pyx_v_self->unique);
    __Pyx_GIVEREF(__pyx_v_self->unique);
    PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_v_self->unique);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":51
 *         self.fields = None
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return \
 *             '<{} sid={}, id={}, name={}, ' \
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_4__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaIndex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_6__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaIndex_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummyIndex___reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummyIndex___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaDummyIndex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_2__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaDummyIndex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":65
 * 
 * cdef class SchemaSpace:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sid = -1
 *         self.owner = -1
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/schema.pyx":66
 * cdef class SchemaSpace:
 *     def __cinit__(self):
 *         self.sid = -1             # <<<<<<<<<<<<<<
 *         self.owner = -1
 *         self.name = None
 */
  __pyx_v_self->sid = -1;

  /* "asynctnt/iproto/schema.pyx":67
 *     def __cinit__(self):
 *         self.sid = -1
 *         self.owner = -1             # <<<<<<<<<<<<<<
 *         self.name = None
 *         self.engine = None
 */
  __pyx_v_self->owner = -1;

  /* "asynctnt/iproto/schema.pyx":68
 *         self.sid = -1
 *         self.owner = -1
 *         self.name = None             # <<<<<<<<<<<<<<
 *         self.engine = None
 *         self.field_count = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* "asynctnt/iproto/schema.pyx":69
 *         self.owner = -1
 *         self.name = None
 *         self.engine = None             # <<<<<<<<<<<<<<
 *         self.field_count = 0
 *         self.flags = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->engine);
  __Pyx_DECREF(__pyx_v_self->engine);
  __pyx_v_self->engine = ((PyObject*)Py_None);

  /* "asynctnt/iproto/schema.pyx":70
 *         self.name = None
 *         self.engine = None
 *         self.field_count = 0             # <<<<<<<<<<<<<<
 *         self.flags = None
 * 
 */
  __pyx_v_self->field_count = 0;

  /* "asynctnt/iproto/schema.pyx":71
 *         self.engine = None
 *         self.field_count = 0
 *         self.flags = None             # <<<<<<<<<<<<<<
 * 
 *         self.fields = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->flags);
  __Pyx_DECREF(__pyx_v_self->flags);
  __pyx_v_self->flags = Py_None;

  /* "asynctnt/iproto/schema.pyx":73
 *         self.flags = None
 * 
 *         self.fields = None             # <<<<<<<<<<<<<<
 *         self.indexes = {}
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fields);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->fields));
  __pyx_v_self->fields = ((struct C_TntFields *)Py_None);

  /* "asynctnt/iproto/schema.pyx":74
 * 
 *         self.fields = None
 *         self.indexes = {}             # <<<<<<<<<<<<<<
 * 
 *     cdef void add_index(self, SchemaIndex idx):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->indexes);
  __Pyx_DECREF(__pyx_v_self->indexes);
  __pyx_v_self->indexes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":65
 * 
 * cdef class SchemaSpace:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sid = -1
 *         self.owner = -1
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaSpace.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":76
 *         self.indexes = {}
 * 
 *     cdef void add_index(self, SchemaIndex idx):             # <<<<<<<<<<<<<<
 *         cpython.dict.PyDict_SetItem(self.indexes, idx.iid, idx)
 *         if idx.name:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11SchemaSpace_add_index(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_index", 0);

  /* "asynctnt/iproto/schema.pyx":77
 * 
 *     cdef void add_index(self, SchemaIndex idx):
 *         cpython.dict.PyDict_SetItem(self.indexes, idx.iid, idx)             # <<<<<<<<<<<<<<
 *         if idx.name:
 *             cpython.dict.PyDict_SetItem(self.indexes, idx.name, idx)
 */
  __pyx_t_1 = __pyx_v_self->indexes;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_idx->iid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_v_idx)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":78
 *     cdef void add_index(self, SchemaIndex idx):
 *         cpython.dict.PyDict_SetItem(self.indexes, idx.iid, idx)
 *         if idx.name:             # <<<<<<<<<<<<<<
 *             cpython.dict.PyDict_SetItem(self.indexes, idx.name, idx)
 * 
 */
  __pyx_t_4 = (__pyx_v_idx->name != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_idx->name) != 0);
  if (__pyx_t_4) {

    /* "asynctnt/iproto/schema.pyx":79
 *         cpython.dict.PyDict_SetItem(self.indexes, idx.iid, idx)
 *         if idx.name:
 *             cpython.dict.PyDict_SetItem(self.indexes, idx.name, idx)             # <<<<<<<<<<<<<<
 * 
 *     cdef SchemaIndex get_index(self, index, create_dummy=True):
 */
    __pyx_t_2 = __pyx_v_self->indexes;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_v_idx->name;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_v_idx)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/schema.pyx":78
 *     cdef void add_index(self, SchemaIndex idx):
 *         cpython.dict.PyDict_SetItem(self.indexes, idx.iid, idx)
 *         if idx.name:             # <<<<<<<<<<<<<<
 *             cpython.dict.PyDict_SetItem(self.indexes, idx.name, idx)
 * 
 */
  }

  /* "asynctnt/iproto/schema.pyx":76
 *         self.indexes = {}
 * 
 *     cdef void add_index(self, SchemaIndex idx):             # <<<<<<<<<<<<<<
 *         cpython.dict.PyDict_SetItem(self.indexes, idx.iid, idx)
 *         if idx.name:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.SchemaSpace.add_index", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/schema.pyx":81
 *             cpython.dict.PyDict_SetItem(self.indexes, idx.name, idx)
 * 
 *     cdef SchemaIndex get_index(self, index, create_dummy=True):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaIndex idx
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_f_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self, PyObject *__pyx_v_index, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index *__pyx_optional_args) {
  PyObject *__pyx_v_create_dummy = ((PyObject *)Py_True);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx = 0;
  int __pyx_v_is_str;
  int __pyx_v_is_int;
  PyObject *__pyx_v_obj_p;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__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_t_7;
  PyObject *__pyx_t_8 = NULL;
  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("get_index", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_create_dummy = __pyx_optional_args->create_dummy;
    }
  }

  /* "asynctnt/iproto/schema.pyx":86
 *             bint is_str, is_int
 *             PyObject *obj_p
 *         is_str = isinstance(index, str)             # <<<<<<<<<<<<<<
 *         is_int = isinstance(index, int)
 *         if not is_str and not is_int:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_index); 
  __pyx_v_is_str = __pyx_t_1;

  /* "asynctnt/iproto/schema.pyx":87
 *             PyObject *obj_p
 *         is_str = isinstance(index, str)
 *         is_int = isinstance(index, int)             # <<<<<<<<<<<<<<
 *         if not is_str and not is_int:
 *             raise TypeError(
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_index); 
  __pyx_v_is_int = __pyx_t_1;

  /* "asynctnt/iproto/schema.pyx":88
 *         is_str = isinstance(index, str)
 *         is_int = isinstance(index, int)
 *         if not is_str and not is_int:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'Index must be either str or int, got: {}'.format(type(index)))
 */
  __pyx_t_2 = ((!(__pyx_v_is_str != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_is_int != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/schema.pyx":90
 *         if not is_str and not is_int:
 *             raise TypeError(
 *                 'Index must be either str or int, got: {}'.format(type(index)))             # <<<<<<<<<<<<<<
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.indexes, index)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Index_must_be_either_str_or_int, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_index))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_index)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asynctnt/iproto/schema.pyx":89
 *         is_int = isinstance(index, int)
 *         if not is_str and not is_int:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'Index must be either str or int, got: {}'.format(type(index)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __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_ERR(0, 89, __pyx_L1_error)

    /* "asynctnt/iproto/schema.pyx":88
 *         is_str = isinstance(index, str)
 *         is_int = isinstance(index, int)
 *         if not is_str and not is_int:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'Index must be either str or int, got: {}'.format(type(index)))
 */
  }

  /* "asynctnt/iproto/schema.pyx":92
 *                 'Index must be either str or int, got: {}'.format(type(index)))
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.indexes, index)             # <<<<<<<<<<<<<<
 *         if obj_p is not NULL:
 *             return <SchemaIndex>obj_p
 */
  __pyx_t_4 = __pyx_v_self->indexes;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_obj_p = PyDict_GetItem(__pyx_t_4, __pyx_v_index);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asynctnt/iproto/schema.pyx":93
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.indexes, index)
 *         if obj_p is not NULL:             # <<<<<<<<<<<<<<
 *             return <SchemaIndex>obj_p
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_obj_p != NULL) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":94
 *         obj_p = cpython.dict.PyDict_GetItem(self.indexes, index)
 *         if obj_p is not NULL:
 *             return <SchemaIndex>obj_p             # <<<<<<<<<<<<<<
 *         else:
 *             if is_int and create_dummy:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_v_obj_p)));
    __pyx_r = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_v_obj_p);
    goto __pyx_L0;

    /* "asynctnt/iproto/schema.pyx":93
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.indexes, index)
 *         if obj_p is not NULL:             # <<<<<<<<<<<<<<
 *             return <SchemaIndex>obj_p
 *         else:
 */
  }

  /* "asynctnt/iproto/schema.pyx":96
 *             return <SchemaIndex>obj_p
 *         else:
 *             if is_int and create_dummy:             # <<<<<<<<<<<<<<
 *                 logger.debug(
 *                     'Index %s not found in space %s/%s. Creating dummy.',
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_is_int != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_create_dummy); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (likely(__pyx_t_1)) {

      /* "asynctnt/iproto/schema.pyx":97
 *         else:
 *             if is_int and create_dummy:
 *                 logger.debug(             # <<<<<<<<<<<<<<
 *                     'Index %s not found in space %s/%s. Creating dummy.',
 *                     index, self.sid, self.name
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asynctnt/iproto/schema.pyx":99
 *                 logger.debug(
 *                     'Index %s not found in space %s/%s. Creating dummy.',
 *                     index, self.sid, self.name             # <<<<<<<<<<<<<<
 *                 )
 *                 idx = SchemaDummyIndex.__new__(SchemaDummyIndex)
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->sid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(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_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_kp_u_Index_s_not_found_in_space_s_s_C, __pyx_v_index, __pyx_t_3, __pyx_v_self->name};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_kp_u_Index_s_not_found_in_space_s_s_C, __pyx_v_index, __pyx_t_3, __pyx_v_self->name};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __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_Index_s_not_found_in_space_s_s_C);
        __Pyx_GIVEREF(__pyx_kp_u_Index_s_not_found_in_space_s_s_C);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_Index_s_not_found_in_space_s_s_C);
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_index);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_3);
        __Pyx_INCREF(__pyx_v_self->name);
        __Pyx_GIVEREF(__pyx_v_self->name);
        PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_self->name);
        __pyx_t_3 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asynctnt/iproto/schema.pyx":101
 *                     index, self.sid, self.name
 *                 )
 *                 idx = SchemaDummyIndex.__new__(SchemaDummyIndex)             # <<<<<<<<<<<<<<
 *                 idx.iid = index
 *                 idx.sid = self.sid
 */
      __pyx_t_4 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummyIndex(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaDummyIndex), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaIndex)))) __PYX_ERR(0, 101, __pyx_L1_error)
      __pyx_v_idx = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "asynctnt/iproto/schema.pyx":102
 *                 )
 *                 idx = SchemaDummyIndex.__new__(SchemaDummyIndex)
 *                 idx.iid = index             # <<<<<<<<<<<<<<
 *                 idx.sid = self.sid
 *                 idx.name = str(index)
 */
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error)
      __pyx_v_idx->iid = __pyx_t_7;

      /* "asynctnt/iproto/schema.pyx":103
 *                 idx = SchemaDummyIndex.__new__(SchemaDummyIndex)
 *                 idx.iid = index
 *                 idx.sid = self.sid             # <<<<<<<<<<<<<<
 *                 idx.name = str(index)
 *                 cpython.dict.PyDict_SetItem(self.indexes, index, idx)
 */
      __pyx_t_7 = __pyx_v_self->sid;
      __pyx_v_idx->sid = __pyx_t_7;

      /* "asynctnt/iproto/schema.pyx":104
 *                 idx.iid = index
 *                 idx.sid = self.sid
 *                 idx.name = str(index)             # <<<<<<<<<<<<<<
 *                 cpython.dict.PyDict_SetItem(self.indexes, index, idx)
 *                 return idx
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_idx->name);
      __Pyx_DECREF(__pyx_v_idx->name);
      __pyx_v_idx->name = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "asynctnt/iproto/schema.pyx":105
 *                 idx.sid = self.sid
 *                 idx.name = str(index)
 *                 cpython.dict.PyDict_SetItem(self.indexes, index, idx)             # <<<<<<<<<<<<<<
 *                 return idx
 *             else:
 */
      __pyx_t_4 = __pyx_v_self->indexes;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = PyDict_SetItem(__pyx_t_4, __pyx_v_index, ((PyObject *)__pyx_v_idx)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asynctnt/iproto/schema.pyx":106
 *                 idx.name = str(index)
 *                 cpython.dict.PyDict_SetItem(self.indexes, index, idx)
 *                 return idx             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TarantoolSchemaError(
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_idx));
      __pyx_r = __pyx_v_idx;
      goto __pyx_L0;

      /* "asynctnt/iproto/schema.pyx":96
 *             return <SchemaIndex>obj_p
 *         else:
 *             if is_int and create_dummy:             # <<<<<<<<<<<<<<
 *                 logger.debug(
 *                     'Index %s not found in space %s/%s. Creating dummy.',
 */
    }

    /* "asynctnt/iproto/schema.pyx":108
 *                 return idx
 *             else:
 *                 raise TarantoolSchemaError(             # <<<<<<<<<<<<<<
 *                     'Index {} not found in space {}/{}'.format(
 *                         index, self.sid, self.name
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TarantoolSchemaError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "asynctnt/iproto/schema.pyx":109
 *             else:
 *                 raise TarantoolSchemaError(
 *                     'Index {} not found in space {}/{}'.format(             # <<<<<<<<<<<<<<
 *                         index, self.sid, self.name
 *                     )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Index_not_found_in_space, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "asynctnt/iproto/schema.pyx":110
 *                 raise TarantoolSchemaError(
 *                     'Index {} not found in space {}/{}'.format(
 *                         index, self.sid, self.name             # <<<<<<<<<<<<<<
 *                     )
 *                 )
 */
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->sid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && 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);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_index, __pyx_t_6, __pyx_v_self->name};
        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_index, __pyx_t_6, __pyx_v_self->name};
        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 109, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_v_index);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_self->name);
        __Pyx_GIVEREF(__pyx_v_self->name);
        PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_7, __pyx_v_self->name);
        __pyx_t_6 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(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);
        }
      }
      __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 108, __pyx_L1_error)
    }
  }

  /* "asynctnt/iproto/schema.pyx":81
 *             cpython.dict.PyDict_SetItem(self.indexes, idx.name, idx)
 * 
 *     cdef SchemaIndex get_index(self, index, create_dummy=True):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaIndex idx
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaSpace.get_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":114
 *                 )
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<{} id={} name={} engine={}>'.format(
 *             self.__class__.__name__,
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_2__repr__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self) {
  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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "asynctnt/iproto/schema.pyx":115
 * 
 *     def __repr__(self):
 *         return '<{} id={} name={} engine={}>'.format(             # <<<<<<<<<<<<<<
 *             self.__class__.__name__,
 *             self.sid, self.name, self.engine
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_id_name_engine, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/schema.pyx":116
 *     def __repr__(self):
 *         return '<{} id={} name={} engine={}>'.format(
 *             self.__class__.__name__,             # <<<<<<<<<<<<<<
 *             self.sid, self.name, self.engine
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asynctnt/iproto/schema.pyx":117
 *         return '<{} id={} name={} engine={}>'.format(
 *             self.__class__.__name__,
 *             self.sid, self.name, self.engine             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->sid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, __pyx_t_3, __pyx_v_self->name, __pyx_v_self->engine};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, __pyx_t_3, __pyx_v_self->name, __pyx_v_self->engine};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->name);
    __Pyx_GIVEREF(__pyx_v_self->name);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_self->name);
    __Pyx_INCREF(__pyx_v_self->engine);
    __Pyx_GIVEREF(__pyx_v_self->engine);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_self->engine);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":114
 *                 )
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<{} id={} name={} engine={}>'.format(
 *             self.__class__.__name__,
 */

  /* function exit code */
  __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_AddTraceback("asynctnt.iproto.protocol.SchemaSpace.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_4__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaSpace.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_6__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11SchemaSpace_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaSpace.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummySpace_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummySpace_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummySpace___reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummySpace___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaDummySpace.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummySpace_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummySpace_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummySpace_2__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_16SchemaDummySpace_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.SchemaDummySpace.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":126
 * 
 * cdef class Schema:
 *     def __cinit__(self, int64_t schema_id):             # <<<<<<<<<<<<<<
 *         self.id = schema_id
 *         self.schema = {}
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_6Schema_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_6Schema_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_schema_id;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_schema_id,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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema_id)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 126, __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_schema_id = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_schema_id == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_6Schema___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self), __pyx_v_schema_id);

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_6Schema___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, int64_t __pyx_v_schema_id) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asynctnt/iproto/schema.pyx":127
 * cdef class Schema:
 *     def __cinit__(self, int64_t schema_id):
 *         self.id = schema_id             # <<<<<<<<<<<<<<
 *         self.schema = {}
 * 
 */
  __pyx_v_self->id = __pyx_v_schema_id;

  /* "asynctnt/iproto/schema.pyx":128
 *     def __cinit__(self, int64_t schema_id):
 *         self.id = schema_id
 *         self.schema = {}             # <<<<<<<<<<<<<<
 * 
 *     cdef SchemaSpace get_space(self, space):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->schema);
  __Pyx_DECREF(__pyx_v_self->schema);
  __pyx_v_self->schema = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":126
 * 
 * cdef class Schema:
 *     def __cinit__(self, int64_t schema_id):             # <<<<<<<<<<<<<<
 *         self.id = schema_id
 *         self.schema = {}
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":130
 *         self.schema = {}
 * 
 *     cdef SchemaSpace get_space(self, space):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj_p = \
 *             cpython.dict.PyDict_GetItem(self.schema, space)
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_get_space(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_space) {
  PyObject *__pyx_v_obj_p;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("get_space", 0);

  /* "asynctnt/iproto/schema.pyx":132
 *     cdef SchemaSpace get_space(self, space):
 *         cdef PyObject *obj_p = \
 *             cpython.dict.PyDict_GetItem(self.schema, space)             # <<<<<<<<<<<<<<
 *         if obj_p is NULL:
 *             return None
 */
  __pyx_t_1 = __pyx_v_self->schema;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_obj_p = PyDict_GetItem(__pyx_t_1, __pyx_v_space);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":133
 *         cdef PyObject *obj_p = \
 *             cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return <SchemaSpace>obj_p
 */
  __pyx_t_2 = ((__pyx_v_obj_p == NULL) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/schema.pyx":134
 *             cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return <SchemaSpace>obj_p
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asynctnt/iproto/schema.pyx":133
 *         cdef PyObject *obj_p = \
 *             cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return <SchemaSpace>obj_p
 */
  }

  /* "asynctnt/iproto/schema.pyx":135
 *         if obj_p is NULL:
 *             return None
 *         return <SchemaSpace>obj_p             # <<<<<<<<<<<<<<
 * 
 *     cdef SchemaSpace get_or_create_space(self, space):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_obj_p)));
  __pyx_r = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_obj_p);
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":130
 *         self.schema = {}
 * 
 *     cdef SchemaSpace get_space(self, space):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj_p = \
 *             cpython.dict.PyDict_GetItem(self.schema, space)
 */

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

/* "asynctnt/iproto/schema.pyx":137
 *         return <SchemaSpace>obj_p
 * 
 *     cdef SchemaSpace get_or_create_space(self, space):             # <<<<<<<<<<<<<<
 *         cdef:
 *             bint is_str, is_int
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_get_or_create_space(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_space) {
  int __pyx_v_is_str;
  int __pyx_v_is_int;
  PyObject *__pyx_v_obj_p;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__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;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_or_create_space", 0);

  /* "asynctnt/iproto/schema.pyx":141
 *             bint is_str, is_int
 *             PyObject *obj_p
 *         is_str = isinstance(space, str)             # <<<<<<<<<<<<<<
 *         is_int = isinstance(space, int)
 *         if not is_str and not is_int:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_space); 
  __pyx_v_is_str = __pyx_t_1;

  /* "asynctnt/iproto/schema.pyx":142
 *             PyObject *obj_p
 *         is_str = isinstance(space, str)
 *         is_int = isinstance(space, int)             # <<<<<<<<<<<<<<
 *         if not is_str and not is_int:
 *             raise TypeError(
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_space); 
  __pyx_v_is_int = __pyx_t_1;

  /* "asynctnt/iproto/schema.pyx":143
 *         is_str = isinstance(space, str)
 *         is_int = isinstance(space, int)
 *         if not is_str and not is_int:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'Space must be either str or int, got: {}'.format(type(space)))
 */
  __pyx_t_2 = ((!(__pyx_v_is_str != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_is_int != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/schema.pyx":145
 *         if not is_str and not is_int:
 *             raise TypeError(
 *                 'Space must be either str or int, got: {}'.format(type(space)))             # <<<<<<<<<<<<<<
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.schema, space)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Space_must_be_either_str_or_int, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_space))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_space)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asynctnt/iproto/schema.pyx":144
 *         is_int = isinstance(space, int)
 *         if not is_str and not is_int:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'Space must be either str or int, got: {}'.format(type(space)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __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_ERR(0, 144, __pyx_L1_error)

    /* "asynctnt/iproto/schema.pyx":143
 *         is_str = isinstance(space, str)
 *         is_int = isinstance(space, int)
 *         if not is_str and not is_int:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'Space must be either str or int, got: {}'.format(type(space)))
 */
  }

  /* "asynctnt/iproto/schema.pyx":147
 *                 'Space must be either str or int, got: {}'.format(type(space)))
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.schema, space)             # <<<<<<<<<<<<<<
 *         if obj_p is NULL:
 *             if is_str:
 */
  __pyx_t_4 = __pyx_v_self->schema;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_obj_p = PyDict_GetItem(__pyx_t_4, __pyx_v_space);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asynctnt/iproto/schema.pyx":148
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:             # <<<<<<<<<<<<<<
 *             if is_str:
 *                 raise TarantoolSchemaError(
 */
  __pyx_t_1 = ((__pyx_v_obj_p == NULL) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":149
 *         obj_p = cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:
 *             if is_str:             # <<<<<<<<<<<<<<
 *                 raise TarantoolSchemaError(
 *                     'Space {} not found'.format(space)
 */
    __pyx_t_1 = (__pyx_v_is_str != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/schema.pyx":150
 *         if obj_p is NULL:
 *             if is_str:
 *                 raise TarantoolSchemaError(             # <<<<<<<<<<<<<<
 *                     'Space {} not found'.format(space)
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TarantoolSchemaError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "asynctnt/iproto/schema.pyx":151
 *             if is_str:
 *                 raise TarantoolSchemaError(
 *                     'Space {} not found'.format(space)             # <<<<<<<<<<<<<<
 *                 )
 *             else:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Space_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && 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);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_space) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_space);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __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_ERR(0, 150, __pyx_L1_error)

      /* "asynctnt/iproto/schema.pyx":149
 *         obj_p = cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:
 *             if is_str:             # <<<<<<<<<<<<<<
 *                 raise TarantoolSchemaError(
 *                     'Space {} not found'.format(space)
 */
    }

    /* "asynctnt/iproto/schema.pyx":154
 *                 )
 *             else:
 *                 return self.create_dummy_space(space)             # <<<<<<<<<<<<<<
 *         return <SchemaSpace>obj_p
 * 
 */
    /*else*/ {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_space); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L1_error)
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->__pyx_vtab)->create_dummy_space(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "asynctnt/iproto/schema.pyx":148
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(self.schema, space)
 *         if obj_p is NULL:             # <<<<<<<<<<<<<<
 *             if is_str:
 *                 raise TarantoolSchemaError(
 */
  }

  /* "asynctnt/iproto/schema.pyx":155
 *             else:
 *                 return self.create_dummy_space(space)
 *         return <SchemaSpace>obj_p             # <<<<<<<<<<<<<<
 * 
 *     cdef SchemaSpace create_dummy_space(self, int space_id):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_obj_p)));
  __pyx_r = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_obj_p);
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":137
 *         return <SchemaSpace>obj_p
 * 
 *     cdef SchemaSpace get_or_create_space(self, space):             # <<<<<<<<<<<<<<
 *         cdef:
 *             bint is_str, is_int
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.get_or_create_space", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":157
 *         return <SchemaSpace>obj_p
 * 
 *     cdef SchemaSpace create_dummy_space(self, int space_id):             # <<<<<<<<<<<<<<
 *         cdef SchemaSpace s
 *         logger.debug('Space %s not found. Creating dummy.', space_id)
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_create_dummy_space(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, int __pyx_v_space_id) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_s = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_dummy_space", 0);

  /* "asynctnt/iproto/schema.pyx":159
 *     cdef SchemaSpace create_dummy_space(self, int space_id):
 *         cdef SchemaSpace s
 *         logger.debug('Space %s not found. Creating dummy.', space_id)             # <<<<<<<<<<<<<<
 *         s = SchemaDummySpace.__new__(SchemaDummySpace)
 *         s.sid = space_id
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_space_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(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);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_Space_s_not_found_Creating_dummy, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_Space_s_not_found_Creating_dummy, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Space_s_not_found_Creating_dummy);
    __Pyx_GIVEREF(__pyx_kp_u_Space_s_not_found_Creating_dummy);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_u_Space_s_not_found_Creating_dummy);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":160
 *         cdef SchemaSpace s
 *         logger.debug('Space %s not found. Creating dummy.', space_id)
 *         s = SchemaDummySpace.__new__(SchemaDummySpace)             # <<<<<<<<<<<<<<
 *         s.sid = space_id
 *         s.name = str(space_id)
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummySpace(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaDummySpace), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace)))) __PYX_ERR(0, 160, __pyx_L1_error)
  __pyx_v_s = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":161
 *         logger.debug('Space %s not found. Creating dummy.', space_id)
 *         s = SchemaDummySpace.__new__(SchemaDummySpace)
 *         s.sid = space_id             # <<<<<<<<<<<<<<
 *         s.name = str(space_id)
 *         cpython.dict.PyDict_SetItem(self.schema, space_id, s)
 */
  __pyx_v_s->sid = __pyx_v_space_id;

  /* "asynctnt/iproto/schema.pyx":162
 *         s = SchemaDummySpace.__new__(SchemaDummySpace)
 *         s.sid = space_id
 *         s.name = str(space_id)             # <<<<<<<<<<<<<<
 *         cpython.dict.PyDict_SetItem(self.schema, space_id, s)
 *         return s
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_space_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_s->name);
  __Pyx_DECREF(__pyx_v_s->name);
  __pyx_v_s->name = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asynctnt/iproto/schema.pyx":163
 *         s.sid = space_id
 *         s.name = str(space_id)
 *         cpython.dict.PyDict_SetItem(self.schema, space_id, s)             # <<<<<<<<<<<<<<
 *         return s
 * 
 */
  __pyx_t_3 = __pyx_v_self->schema;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_space_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_v_s)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":164
 *         s.name = str(space_id)
 *         cpython.dict.PyDict_SetItem(self.schema, space_id, s)
 *         return s             # <<<<<<<<<<<<<<
 * 
 *     cdef inline clear(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_s));
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":157
 *         return <SchemaSpace>obj_p
 * 
 *     cdef SchemaSpace create_dummy_space(self, int space_id):             # <<<<<<<<<<<<<<
 *         cdef SchemaSpace s
 *         logger.debug('Space %s not found. Creating dummy.', space_id)
 */

  /* function exit code */
  __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_6);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.create_dummy_space", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_s);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":166
 *         return s
 * 
 *     cdef inline clear(self):             # <<<<<<<<<<<<<<
 *         self.schema.clear()
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_clear(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__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", 0);

  /* "asynctnt/iproto/schema.pyx":167
 * 
 *     cdef inline clear(self):
 *         self.schema.clear()             # <<<<<<<<<<<<<<
 * 
 *     cdef SchemaSpace parse_space(self, space_row):
 */
  if (unlikely(__pyx_v_self->schema == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
    __PYX_ERR(0, 167, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->schema); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 167, __pyx_L1_error)

  /* "asynctnt/iproto/schema.pyx":166
 *         return s
 * 
 *     cdef inline clear(self):             # <<<<<<<<<<<<<<
 *         self.schema.clear()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":169
 *         self.schema.clear()
 * 
 *     cdef SchemaSpace parse_space(self, space_row):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse_space(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_space_row) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  size_t __pyx_v_k;
  size_t __pyx_v_row_len;
  PyObject *__pyx_v_format_list = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_field_id;
  PyObject *__pyx_v_field_name = NULL;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_space", 0);

  /* "asynctnt/iproto/schema.pyx":176
 *             list format_list
 * 
 *         assert space_row is not None             # <<<<<<<<<<<<<<
 * 
 *         sp = SchemaSpace.__new__(SchemaSpace)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = (__pyx_v_space_row != Py_None);
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 176, __pyx_L1_error)
    }
  }
  #endif

  /* "asynctnt/iproto/schema.pyx":178
 *         assert space_row is not None
 * 
 *         sp = SchemaSpace.__new__(SchemaSpace)             # <<<<<<<<<<<<<<
 *         row_len = <size_t>len(space_row)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaSpace(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":179
 * 
 *         sp = SchemaSpace.__new__(SchemaSpace)
 *         row_len = <size_t>len(space_row)             # <<<<<<<<<<<<<<
 * 
 *         k = 0
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_space_row); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error)
  __pyx_v_row_len = ((size_t)__pyx_t_3);

  /* "asynctnt/iproto/schema.pyx":181
 *         row_len = <size_t>len(space_row)
 * 
 *         k = 0             # <<<<<<<<<<<<<<
 *         sp.sid = <int>space_row[k]
 *         k += 1
 */
  __pyx_v_k = 0;

  /* "asynctnt/iproto/schema.pyx":182
 * 
 *         k = 0
 *         sp.sid = <int>space_row[k]             # <<<<<<<<<<<<<<
 *         k += 1
 *         if k < row_len:
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sp->sid = ((int)__pyx_t_4);

  /* "asynctnt/iproto/schema.pyx":183
 *         k = 0
 *         sp.sid = <int>space_row[k]
 *         k += 1             # <<<<<<<<<<<<<<
 *         if k < row_len:
 *             sp.owner = <int>space_row[k]
 */
  __pyx_v_k = (__pyx_v_k + 1);

  /* "asynctnt/iproto/schema.pyx":184
 *         sp.sid = <int>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.owner = <int>space_row[k]
 *         k += 1
 */
  __pyx_t_1 = ((__pyx_v_k < __pyx_v_row_len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":185
 *         k += 1
 *         if k < row_len:
 *             sp.owner = <int>space_row[k]             # <<<<<<<<<<<<<<
 *         k += 1
 *         if k < row_len:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_sp->owner = ((int)__pyx_t_4);

    /* "asynctnt/iproto/schema.pyx":184
 *         sp.sid = <int>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.owner = <int>space_row[k]
 *         k += 1
 */
  }

  /* "asynctnt/iproto/schema.pyx":186
 *         if k < row_len:
 *             sp.owner = <int>space_row[k]
 *         k += 1             # <<<<<<<<<<<<<<
 *         if k < row_len:
 *             sp.name = <str>space_row[k]
 */
  __pyx_v_k = (__pyx_v_k + 1);

  /* "asynctnt/iproto/schema.pyx":187
 *             sp.owner = <int>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.name = <str>space_row[k]
 *         k += 1
 */
  __pyx_t_1 = ((__pyx_v_k < __pyx_v_row_len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":188
 *         k += 1
 *         if k < row_len:
 *             sp.name = <str>space_row[k]             # <<<<<<<<<<<<<<
 *         k += 1
 *         if k < row_len:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_sp->name);
    __Pyx_DECREF(__pyx_v_sp->name);
    __pyx_v_sp->name = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "asynctnt/iproto/schema.pyx":187
 *             sp.owner = <int>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.name = <str>space_row[k]
 *         k += 1
 */
  }

  /* "asynctnt/iproto/schema.pyx":189
 *         if k < row_len:
 *             sp.name = <str>space_row[k]
 *         k += 1             # <<<<<<<<<<<<<<
 *         if k < row_len:
 *             sp.engine = <str>space_row[k]
 */
  __pyx_v_k = (__pyx_v_k + 1);

  /* "asynctnt/iproto/schema.pyx":190
 *             sp.name = <str>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.engine = <str>space_row[k]
 *         k += 1
 */
  __pyx_t_1 = ((__pyx_v_k < __pyx_v_row_len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":191
 *         k += 1
 *         if k < row_len:
 *             sp.engine = <str>space_row[k]             # <<<<<<<<<<<<<<
 *         k += 1
 *         if k < row_len:
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_sp->engine);
    __Pyx_DECREF(__pyx_v_sp->engine);
    __pyx_v_sp->engine = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":190
 *             sp.name = <str>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.engine = <str>space_row[k]
 *         k += 1
 */
  }

  /* "asynctnt/iproto/schema.pyx":192
 *         if k < row_len:
 *             sp.engine = <str>space_row[k]
 *         k += 1             # <<<<<<<<<<<<<<
 *         if k < row_len:
 *             sp.field_count = <int>space_row[k]
 */
  __pyx_v_k = (__pyx_v_k + 1);

  /* "asynctnt/iproto/schema.pyx":193
 *             sp.engine = <str>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.field_count = <int>space_row[k]
 *         k += 1
 */
  __pyx_t_1 = ((__pyx_v_k < __pyx_v_row_len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":194
 *         k += 1
 *         if k < row_len:
 *             sp.field_count = <int>space_row[k]             # <<<<<<<<<<<<<<
 *         k += 1
 *         if k < row_len:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_sp->field_count = ((int)__pyx_t_4);

    /* "asynctnt/iproto/schema.pyx":193
 *             sp.engine = <str>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.field_count = <int>space_row[k]
 *         k += 1
 */
  }

  /* "asynctnt/iproto/schema.pyx":195
 *         if k < row_len:
 *             sp.field_count = <int>space_row[k]
 *         k += 1             # <<<<<<<<<<<<<<
 *         if k < row_len:
 *             sp.flags = space_row[k]
 */
  __pyx_v_k = (__pyx_v_k + 1);

  /* "asynctnt/iproto/schema.pyx":196
 *             sp.field_count = <int>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.flags = space_row[k]
 *         k += 1
 */
  __pyx_t_1 = ((__pyx_v_k < __pyx_v_row_len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":197
 *         k += 1
 *         if k < row_len:
 *             sp.flags = space_row[k]             # <<<<<<<<<<<<<<
 *         k += 1
 *         if k < row_len:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_sp->flags);
    __Pyx_DECREF(__pyx_v_sp->flags);
    __pyx_v_sp->flags = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":196
 *             sp.field_count = <int>space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             sp.flags = space_row[k]
 *         k += 1
 */
  }

  /* "asynctnt/iproto/schema.pyx":198
 *         if k < row_len:
 *             sp.flags = space_row[k]
 *         k += 1             # <<<<<<<<<<<<<<
 *         if k < row_len:
 *             # format
 */
  __pyx_v_k = (__pyx_v_k + 1);

  /* "asynctnt/iproto/schema.pyx":199
 *             sp.flags = space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             # format
 *             format_list = <list>space_row[k]
 */
  __pyx_t_1 = ((__pyx_v_k < __pyx_v_row_len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":201
 *         if k < row_len:
 *             # format
 *             format_list = <list>space_row[k]             # <<<<<<<<<<<<<<
 *             if len(format_list) > 0:
 *                 sp.fields = TntFields.__new__(TntFields)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_space_row, __pyx_v_k, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_format_list = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "asynctnt/iproto/schema.pyx":202
 *             # format
 *             format_list = <list>space_row[k]
 *             if len(format_list) > 0:             # <<<<<<<<<<<<<<
 *                 sp.fields = TntFields.__new__(TntFields)
 *                 for i in range(len(format_list)):
 */
    if (unlikely(__pyx_v_format_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 202, __pyx_L1_error)
    }
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_format_list); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_3 > 0) != 0);
    if (__pyx_t_1) {

      /* "asynctnt/iproto/schema.pyx":203
 *             format_list = <list>space_row[k]
 *             if len(format_list) > 0:
 *                 sp.fields = TntFields.__new__(TntFields)             # <<<<<<<<<<<<<<
 *                 for i in range(len(format_list)):
 *                     field_id = i
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_TntFields), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
      __Pyx_GOTREF(__pyx_v_sp->fields);
      __Pyx_DECREF(((PyObject *)__pyx_v_sp->fields));
      __pyx_v_sp->fields = ((struct C_TntFields *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "asynctnt/iproto/schema.pyx":204
 *             if len(format_list) > 0:
 *                 sp.fields = TntFields.__new__(TntFields)
 *                 for i in range(len(format_list)):             # <<<<<<<<<<<<<<
 *                     field_id = i
 *                     field_name = format_list[i]['name']
 */
      if (unlikely(__pyx_v_format_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 204, __pyx_L1_error)
      }
      __pyx_t_3 = PyList_GET_SIZE(__pyx_v_format_list); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L1_error)
      __pyx_t_6 = __pyx_t_3;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "asynctnt/iproto/schema.pyx":205
 *                 sp.fields = TntFields.__new__(TntFields)
 *                 for i in range(len(format_list)):
 *                     field_id = i             # <<<<<<<<<<<<<<
 *                     field_name = format_list[i]['name']
 *                     # field_type = format_list[i]['type']
 */
        __pyx_v_field_id = __pyx_v_i;

        /* "asynctnt/iproto/schema.pyx":206
 *                 for i in range(len(format_list)):
 *                     field_id = i
 *                     field_name = format_list[i]['name']             # <<<<<<<<<<<<<<
 *                     # field_type = format_list[i]['type']
 * 
 */
        if (unlikely(__pyx_v_format_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 206, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_format_list, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_field_name, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "asynctnt/iproto/schema.pyx":209
 *                     # field_type = format_list[i]['type']
 * 
 *                     sp.fields.add(field_id, field_name)             # <<<<<<<<<<<<<<
 * 
 *         return sp
 */
        if (!(likely(PyUnicode_CheckExact(__pyx_v_field_name))||((__pyx_v_field_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_field_name)->tp_name), 0))) __PYX_ERR(0, 209, __pyx_L1_error)
        __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(__pyx_v_sp->fields, __pyx_v_field_id, ((PyObject*)__pyx_v_field_name));
      }

      /* "asynctnt/iproto/schema.pyx":202
 *             # format
 *             format_list = <list>space_row[k]
 *             if len(format_list) > 0:             # <<<<<<<<<<<<<<
 *                 sp.fields = TntFields.__new__(TntFields)
 *                 for i in range(len(format_list)):
 */
    }

    /* "asynctnt/iproto/schema.pyx":199
 *             sp.flags = space_row[k]
 *         k += 1
 *         if k < row_len:             # <<<<<<<<<<<<<<
 *             # format
 *             format_list = <list>space_row[k]
 */
  }

  /* "asynctnt/iproto/schema.pyx":211
 *                     sp.fields.add(field_id, field_name)
 * 
 *         return sp             # <<<<<<<<<<<<<<
 * 
 *     cdef SchemaIndex parse_index(self, index_row):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_sp));
  __pyx_r = __pyx_v_sp;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":169
 *         self.schema.clear()
 * 
 *     cdef SchemaSpace parse_space(self, space_row):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.parse_space", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XDECREF(__pyx_v_format_list);
  __Pyx_XDECREF(__pyx_v_field_name);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":213
 *         return sp
 * 
 *     cdef SchemaIndex parse_index(self, index_row):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaIndex idx
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse_index(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, PyObject *__pyx_v_index_row) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  uint32_t __pyx_v_i;
  int __pyx_v_field_id;
  CYTHON_UNUSED PyObject *__pyx_v_field_type = 0;
  PyObject *__pyx_v_parts = NULL;
  PyObject *__pyx_v_part = NULL;
  PyObject *__pyx_v_f = NULL;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  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;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  long __pyx_t_14;
  long __pyx_t_15;
  uint32_t __pyx_t_16;
  long __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_index", 0);

  /* "asynctnt/iproto/schema.pyx":218
 *             SchemaSpace sp
 *             uint32_t i
 *             int field_id = -1             # <<<<<<<<<<<<<<
 *             str field_type
 * 
 */
  __pyx_v_field_id = -1;

  /* "asynctnt/iproto/schema.pyx":221
 *             str field_type
 * 
 *         assert index_row is not None             # <<<<<<<<<<<<<<
 * 
 *         idx = SchemaIndex.__new__(SchemaIndex)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = (__pyx_v_index_row != Py_None);
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 221, __pyx_L1_error)
    }
  }
  #endif

  /* "asynctnt/iproto/schema.pyx":223
 *         assert index_row is not None
 * 
 *         idx = SchemaIndex.__new__(SchemaIndex)             # <<<<<<<<<<<<<<
 *         idx.sid = <int>index_row[0]
 *         idx.iid = <int>index_row[1]
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaIndex(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_SchemaIndex), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_idx = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":224
 * 
 *         idx = SchemaIndex.__new__(SchemaIndex)
 *         idx.sid = <int>index_row[0]             # <<<<<<<<<<<<<<
 *         idx.iid = <int>index_row[1]
 *         idx.name = <str>index_row[2]
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_idx->sid = ((int)__pyx_t_3);

  /* "asynctnt/iproto/schema.pyx":225
 *         idx = SchemaIndex.__new__(SchemaIndex)
 *         idx.sid = <int>index_row[0]
 *         idx.iid = <int>index_row[1]             # <<<<<<<<<<<<<<
 *         idx.name = <str>index_row[2]
 *         idx.index_type = <str>index_row[3]
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_idx->iid = ((int)__pyx_t_3);

  /* "asynctnt/iproto/schema.pyx":226
 *         idx.sid = <int>index_row[0]
 *         idx.iid = <int>index_row[1]
 *         idx.name = <str>index_row[2]             # <<<<<<<<<<<<<<
 *         idx.index_type = <str>index_row[3]
 *         idx.unique = <object>index_row[4]
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_idx->name);
  __Pyx_DECREF(__pyx_v_idx->name);
  __pyx_v_idx->name = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asynctnt/iproto/schema.pyx":227
 *         idx.iid = <int>index_row[1]
 *         idx.name = <str>index_row[2]
 *         idx.index_type = <str>index_row[3]             # <<<<<<<<<<<<<<
 *         idx.unique = <object>index_row[4]
 *         idx.fields = None
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_index_row, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_idx->index_type);
  __Pyx_DECREF(__pyx_v_idx->index_type);
  __pyx_v_idx->index_type = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":228
 *         idx.name = <str>index_row[2]
 *         idx.index_type = <str>index_row[3]
 *         idx.unique = <object>index_row[4]             # <<<<<<<<<<<<<<
 *         idx.fields = None
 * 
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_idx->unique);
  __Pyx_DECREF(__pyx_v_idx->unique);
  __pyx_v_idx->unique = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asynctnt/iproto/schema.pyx":229
 *         idx.index_type = <str>index_row[3]
 *         idx.unique = <object>index_row[4]
 *         idx.fields = None             # <<<<<<<<<<<<<<
 * 
 *         sp = self.get_space(idx.sid)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_idx->fields);
  __Pyx_DECREF(((PyObject *)__pyx_v_idx->fields));
  __pyx_v_idx->fields = ((struct C_TntFields *)Py_None);

  /* "asynctnt/iproto/schema.pyx":231
 *         idx.fields = None
 * 
 *         sp = self.get_space(idx.sid)             # <<<<<<<<<<<<<<
 *         if sp is None:
 *             raise TarantoolSchemaError(
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_idx->sid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->__pyx_vtab)->get_space(__pyx_v_self, __pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":232
 * 
 *         sp = self.get_space(idx.sid)
 *         if sp is None:             # <<<<<<<<<<<<<<
 *             raise TarantoolSchemaError(
 *                 'Space with id {} not found'.format(idx.sid))
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_sp) == Py_None);
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "asynctnt/iproto/schema.pyx":233
 *         sp = self.get_space(idx.sid)
 *         if sp is None:
 *             raise TarantoolSchemaError(             # <<<<<<<<<<<<<<
 *                 'Space with id {} not found'.format(idx.sid))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_TarantoolSchemaError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "asynctnt/iproto/schema.pyx":234
 *         if sp is None:
 *             raise TarantoolSchemaError(
 *                 'Space with id {} not found'.format(idx.sid))             # <<<<<<<<<<<<<<
 * 
 *         if sp.fields is not None:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Space_with_id_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_idx->sid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(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);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 233, __pyx_L1_error)

    /* "asynctnt/iproto/schema.pyx":232
 * 
 *         sp = self.get_space(idx.sid)
 *         if sp is None:             # <<<<<<<<<<<<<<
 *             raise TarantoolSchemaError(
 *                 'Space with id {} not found'.format(idx.sid))
 */
  }

  /* "asynctnt/iproto/schema.pyx":236
 *                 'Space with id {} not found'.format(idx.sid))
 * 
 *         if sp.fields is not None:             # <<<<<<<<<<<<<<
 *             parts = index_row[5]
 *             if isinstance(parts, (list, tuple)):
 */
  __pyx_t_5 = (((PyObject *)__pyx_v_sp->fields) != Py_None);
  __pyx_t_1 = (__pyx_t_5 != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":237
 * 
 *         if sp.fields is not None:
 *             parts = index_row[5]             # <<<<<<<<<<<<<<
 *             if isinstance(parts, (list, tuple)):
 *                 idx.fields = TntFields.__new__(TntFields)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_parts = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":238
 *         if sp.fields is not None:
 *             parts = index_row[5]
 *             if isinstance(parts, (list, tuple)):             # <<<<<<<<<<<<<<
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for part in parts:
 */
    __pyx_t_5 = PyList_Check(__pyx_v_parts); 
    __pyx_t_10 = (__pyx_t_5 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_1 = __pyx_t_10;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_10 = PyTuple_Check(__pyx_v_parts); 
    __pyx_t_5 = (__pyx_t_10 != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L6_bool_binop_done:;
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "asynctnt/iproto/schema.pyx":239
 *             parts = index_row[5]
 *             if isinstance(parts, (list, tuple)):
 *                 idx.fields = TntFields.__new__(TntFields)             # <<<<<<<<<<<<<<
 *                 for part in parts:
 *                     if isinstance(part, (list, tuple)):
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_TntFields), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __Pyx_GOTREF(__pyx_v_idx->fields);
      __Pyx_DECREF(((PyObject *)__pyx_v_idx->fields));
      __pyx_v_idx->fields = ((struct C_TntFields *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "asynctnt/iproto/schema.pyx":240
 *             if isinstance(parts, (list, tuple)):
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for part in parts:             # <<<<<<<<<<<<<<
 *                     if isinstance(part, (list, tuple)):
 *                         assert len(part) == 2, 'Part len must be 2'
 */
      if (likely(PyList_CheckExact(__pyx_v_parts)) || PyTuple_CheckExact(__pyx_v_parts)) {
        __pyx_t_2 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 240, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_12(__pyx_t_2);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 240, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "asynctnt/iproto/schema.pyx":241
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for part in parts:
 *                     if isinstance(part, (list, tuple)):             # <<<<<<<<<<<<<<
 *                         assert len(part) == 2, 'Part len must be 2'
 *                         field_id = part[0]
 */
        __pyx_t_1 = PyList_Check(__pyx_v_part); 
        __pyx_t_10 = (__pyx_t_1 != 0);
        if (!__pyx_t_10) {
        } else {
          __pyx_t_5 = __pyx_t_10;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_10 = PyTuple_Check(__pyx_v_part); 
        __pyx_t_1 = (__pyx_t_10 != 0);
        __pyx_t_5 = __pyx_t_1;
        __pyx_L11_bool_binop_done:;
        __pyx_t_1 = (__pyx_t_5 != 0);
        if (__pyx_t_1) {

          /* "asynctnt/iproto/schema.pyx":242
 *                 for part in parts:
 *                     if isinstance(part, (list, tuple)):
 *                         assert len(part) == 2, 'Part len must be 2'             # <<<<<<<<<<<<<<
 *                         field_id = part[0]
 *                         field_type = part[1]
 */
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(!Py_OptimizeFlag)) {
            __pyx_t_13 = PyObject_Length(__pyx_v_part); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 242, __pyx_L1_error)
            if (unlikely(!((__pyx_t_13 == 2) != 0))) {
              PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Part_len_must_be_2);
              __PYX_ERR(0, 242, __pyx_L1_error)
            }
          }
          #endif

          /* "asynctnt/iproto/schema.pyx":243
 *                     if isinstance(part, (list, tuple)):
 *                         assert len(part) == 2, 'Part len must be 2'
 *                         field_id = part[0]             # <<<<<<<<<<<<<<
 *                         field_type = part[1]
 *                     elif isinstance(part, dict):
 */
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_part, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_field_id = __pyx_t_3;

          /* "asynctnt/iproto/schema.pyx":244
 *                         assert len(part) == 2, 'Part len must be 2'
 *                         field_id = part[0]
 *                         field_type = part[1]             # <<<<<<<<<<<<<<
 *                     elif isinstance(part, dict):
 *                         field_id = part['field']
 */
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_part, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 244, __pyx_L1_error)
          __Pyx_XDECREF_SET(__pyx_v_field_type, ((PyObject*)__pyx_t_4));
          __pyx_t_4 = 0;

          /* "asynctnt/iproto/schema.pyx":241
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for part in parts:
 *                     if isinstance(part, (list, tuple)):             # <<<<<<<<<<<<<<
 *                         assert len(part) == 2, 'Part len must be 2'
 *                         field_id = part[0]
 */
          goto __pyx_L10;
        }

        /* "asynctnt/iproto/schema.pyx":245
 *                         field_id = part[0]
 *                         field_type = part[1]
 *                     elif isinstance(part, dict):             # <<<<<<<<<<<<<<
 *                         field_id = part['field']
 *                         field_type = part['type']
 */
        __pyx_t_1 = PyDict_Check(__pyx_v_part); 
        __pyx_t_5 = (__pyx_t_1 != 0);
        if (__pyx_t_5) {

          /* "asynctnt/iproto/schema.pyx":246
 *                         field_type = part[1]
 *                     elif isinstance(part, dict):
 *                         field_id = part['field']             # <<<<<<<<<<<<<<
 *                         field_type = part['type']
 *                         # TODO: add is_nullable and collation if we really need
 */
          __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_part, __pyx_n_u_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_field_id = __pyx_t_3;

          /* "asynctnt/iproto/schema.pyx":247
 *                     elif isinstance(part, dict):
 *                         field_id = part['field']
 *                         field_type = part['type']             # <<<<<<<<<<<<<<
 *                         # TODO: add is_nullable and collation if we really need
 *                         # TODO: it in a python driver
 */
          __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_part, __pyx_n_u_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 247, __pyx_L1_error)
          __Pyx_XDECREF_SET(__pyx_v_field_type, ((PyObject*)__pyx_t_4));
          __pyx_t_4 = 0;

          /* "asynctnt/iproto/schema.pyx":245
 *                         field_id = part[0]
 *                         field_type = part[1]
 *                     elif isinstance(part, dict):             # <<<<<<<<<<<<<<
 *                         field_id = part['field']
 *                         field_type = part['type']
 */
        }
        __pyx_L10:;

        /* "asynctnt/iproto/schema.pyx":251
 *                         # TODO: it in a python driver
 * 
 *                     if field_id < sp.fields.len():             # <<<<<<<<<<<<<<
 *                         f = sp.fields.name_by_id(field_id)
 *                         idx.fields.add(field_id, f)
 */
        __pyx_t_5 = ((__pyx_v_field_id < __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(__pyx_v_sp->fields)) != 0);
        if (__pyx_t_5) {

          /* "asynctnt/iproto/schema.pyx":252
 * 
 *                     if field_id < sp.fields.len():
 *                         f = sp.fields.name_by_id(field_id)             # <<<<<<<<<<<<<<
 *                         idx.fields.add(field_id, f)
 *                     else:
 */
          __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(__pyx_v_sp->fields, __pyx_v_field_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_v_f, ((PyObject*)__pyx_t_4));
          __pyx_t_4 = 0;

          /* "asynctnt/iproto/schema.pyx":253
 *                     if field_id < sp.fields.len():
 *                         f = sp.fields.name_by_id(field_id)
 *                         idx.fields.add(field_id, f)             # <<<<<<<<<<<<<<
 *                     else:
 *                         logger.debug(
 */
          __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(__pyx_v_idx->fields, __pyx_v_field_id, __pyx_v_f);

          /* "asynctnt/iproto/schema.pyx":251
 *                         # TODO: it in a python driver
 * 
 *                     if field_id < sp.fields.len():             # <<<<<<<<<<<<<<
 *                         f = sp.fields.name_by_id(field_id)
 *                         idx.fields.add(field_id, f)
 */
          goto __pyx_L13;
        }

        /* "asynctnt/iproto/schema.pyx":255
 *                         idx.fields.add(field_id, f)
 *                     else:
 *                         logger.debug(             # <<<<<<<<<<<<<<
 *                             'Field #%d of space %s is not '
 *                             'in space format definition', field_id, sp.name)
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "asynctnt/iproto/schema.pyx":257
 *                         logger.debug(
 *                             'Field #%d of space %s is not '
 *                             'in space format definition', field_id, sp.name)             # <<<<<<<<<<<<<<
 *                         idx.fields.add(field_id, '')
 *             else:
 */
          __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_field_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = NULL;
          __pyx_t_3 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(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);
              __pyx_t_3 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_kp_u_Field_d_of_space_s_is_not_in_spa, __pyx_t_6, __pyx_v_sp->name};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_kp_u_Field_d_of_space_s_is_not_in_spa, __pyx_t_6, __pyx_v_sp->name};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_9 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __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_Field_d_of_space_s_is_not_in_spa);
            __Pyx_GIVEREF(__pyx_kp_u_Field_d_of_space_s_is_not_in_spa);
            PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_3, __pyx_kp_u_Field_d_of_space_s_is_not_in_spa);
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_3, __pyx_t_6);
            __Pyx_INCREF(__pyx_v_sp->name);
            __Pyx_GIVEREF(__pyx_v_sp->name);
            PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_3, __pyx_v_sp->name);
            __pyx_t_6 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "asynctnt/iproto/schema.pyx":258
 *                             'Field #%d of space %s is not '
 *                             'in space format definition', field_id, sp.name)
 *                         idx.fields.add(field_id, '')             # <<<<<<<<<<<<<<
 *             else:
 *                 idx.fields = TntFields.__new__(TntFields)
 */
          __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(__pyx_v_idx->fields, __pyx_v_field_id, __pyx_kp_u__12);
        }
        __pyx_L13:;

        /* "asynctnt/iproto/schema.pyx":240
 *             if isinstance(parts, (list, tuple)):
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for part in parts:             # <<<<<<<<<<<<<<
 *                     if isinstance(part, (list, tuple)):
 *                         assert len(part) == 2, 'Part len must be 2'
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asynctnt/iproto/schema.pyx":238
 *         if sp.fields is not None:
 *             parts = index_row[5]
 *             if isinstance(parts, (list, tuple)):             # <<<<<<<<<<<<<<
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for part in parts:
 */
      goto __pyx_L5;
    }

    /* "asynctnt/iproto/schema.pyx":260
 *                         idx.fields.add(field_id, '')
 *             else:
 *                 idx.fields = TntFields.__new__(TntFields)             # <<<<<<<<<<<<<<
 *                 for i in range(index_row[5]):
 *                     field_id = index_row[5 + 1 + i * 2]
 */
    /*else*/ {
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_TntFields), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __Pyx_GOTREF(__pyx_v_idx->fields);
      __Pyx_DECREF(((PyObject *)__pyx_v_idx->fields));
      __pyx_v_idx->fields = ((struct C_TntFields *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "asynctnt/iproto/schema.pyx":261
 *             else:
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for i in range(index_row[5]):             # <<<<<<<<<<<<<<
 *                     field_id = index_row[5 + 1 + i * 2]
 *                     field_type = index_row[5 + 2 + i * 2]
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_15 = __pyx_t_14;
      for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
        __pyx_v_i = __pyx_t_16;

        /* "asynctnt/iproto/schema.pyx":262
 *                 idx.fields = TntFields.__new__(TntFields)
 *                 for i in range(index_row[5]):
 *                     field_id = index_row[5 + 1 + i * 2]             # <<<<<<<<<<<<<<
 *                     field_type = index_row[5 + 2 + i * 2]
 * 
 */
        __pyx_t_17 = (6 + (__pyx_v_i * 2));
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, __pyx_t_17, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_field_id = __pyx_t_3;

        /* "asynctnt/iproto/schema.pyx":263
 *                 for i in range(index_row[5]):
 *                     field_id = index_row[5 + 1 + i * 2]
 *                     field_type = index_row[5 + 2 + i * 2]             # <<<<<<<<<<<<<<
 * 
 *                     if field_id < sp.fields.len():
 */
        __pyx_t_17 = (7 + (__pyx_v_i * 2));
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_index_row, __pyx_t_17, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 263, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_field_type, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "asynctnt/iproto/schema.pyx":265
 *                     field_type = index_row[5 + 2 + i * 2]
 * 
 *                     if field_id < sp.fields.len():             # <<<<<<<<<<<<<<
 *                         f = sp.fields.name_by_id(field_id)
 *                         idx.fields.add(field_id, f)
 */
        __pyx_t_5 = ((__pyx_v_field_id < __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(__pyx_v_sp->fields)) != 0);
        if (__pyx_t_5) {

          /* "asynctnt/iproto/schema.pyx":266
 * 
 *                     if field_id < sp.fields.len():
 *                         f = sp.fields.name_by_id(field_id)             # <<<<<<<<<<<<<<
 *                         idx.fields.add(field_id, f)
 *                     else:
 */
          __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(__pyx_v_sp->fields, __pyx_v_field_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_f, ((PyObject*)__pyx_t_2));
          __pyx_t_2 = 0;

          /* "asynctnt/iproto/schema.pyx":267
 *                     if field_id < sp.fields.len():
 *                         f = sp.fields.name_by_id(field_id)
 *                         idx.fields.add(field_id, f)             # <<<<<<<<<<<<<<
 *                     else:
 *                         logger.debug(
 */
          __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(__pyx_v_idx->fields, __pyx_v_field_id, __pyx_v_f);

          /* "asynctnt/iproto/schema.pyx":265
 *                     field_type = index_row[5 + 2 + i * 2]
 * 
 *                     if field_id < sp.fields.len():             # <<<<<<<<<<<<<<
 *                         f = sp.fields.name_by_id(field_id)
 *                         idx.fields.add(field_id, f)
 */
          goto __pyx_L16;
        }

        /* "asynctnt/iproto/schema.pyx":269
 *                         idx.fields.add(field_id, f)
 *                     else:
 *                         logger.debug(             # <<<<<<<<<<<<<<
 *                             'Field #%d of space %s is not '
 *                             'in space format definition', field_id, sp.name)
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "asynctnt/iproto/schema.pyx":271
 *                         logger.debug(
 *                             'Field #%d of space %s is not '
 *                             'in space format definition', field_id, sp.name)             # <<<<<<<<<<<<<<
 *                         idx.fields.add(field_id, '')
 * 
 */
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_field_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_9 = NULL;
          __pyx_t_3 = 0;
          if (CYTHON_UNPACK_METHODS && 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_3 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_Field_d_of_space_s_is_not_in_spa, __pyx_t_4, __pyx_v_sp->name};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_Field_d_of_space_s_is_not_in_spa, __pyx_t_4, __pyx_v_sp->name};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_6 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (__pyx_t_9) {
              __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
            }
            __Pyx_INCREF(__pyx_kp_u_Field_d_of_space_s_is_not_in_spa);
            __Pyx_GIVEREF(__pyx_kp_u_Field_d_of_space_s_is_not_in_spa);
            PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, __pyx_kp_u_Field_d_of_space_s_is_not_in_spa);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_t_4);
            __Pyx_INCREF(__pyx_v_sp->name);
            __Pyx_GIVEREF(__pyx_v_sp->name);
            PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_3, __pyx_v_sp->name);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "asynctnt/iproto/schema.pyx":272
 *                             'Field #%d of space %s is not '
 *                             'in space format definition', field_id, sp.name)
 *                         idx.fields.add(field_id, '')             # <<<<<<<<<<<<<<
 * 
 *         return idx
 */
          __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(__pyx_v_idx->fields, __pyx_v_field_id, __pyx_kp_u__12);
        }
        __pyx_L16:;
      }
    }
    __pyx_L5:;

    /* "asynctnt/iproto/schema.pyx":236
 *                 'Space with id {} not found'.format(idx.sid))
 * 
 *         if sp.fields is not None:             # <<<<<<<<<<<<<<
 *             parts = index_row[5]
 *             if isinstance(parts, (list, tuple)):
 */
  }

  /* "asynctnt/iproto/schema.pyx":274
 *                         idx.fields.add(field_id, '')
 * 
 *         return idx             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_idx));
  __pyx_r = __pyx_v_idx;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":213
 *         return sp
 * 
 *     cdef SchemaIndex parse_index(self, index_row):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaIndex idx
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.parse_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_idx);
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XDECREF(__pyx_v_field_type);
  __Pyx_XDECREF(__pyx_v_parts);
  __Pyx_XDECREF(__pyx_v_part);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":277
 * 
 *     @staticmethod
 *     cdef Schema parse(int64_t schema_id, spaces, indexes):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Schema s
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse(int64_t __pyx_v_schema_id, PyObject *__pyx_v_spaces, PyObject *__pyx_v_indexes) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_s = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx = 0;
  PyObject *__pyx_v_space_row = NULL;
  PyObject *__pyx_v_index_row = NULL;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse", 0);

  /* "asynctnt/iproto/schema.pyx":283
 *             SchemaIndex idx
 * 
 *         s = Schema.__new__(Schema, schema_id)             # <<<<<<<<<<<<<<
 *         for space_row in spaces:
 *             sp = s.parse_space(space_row)
 */
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_schema_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __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 = 0;
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_Schema(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_Schema), __pyx_t_2, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_s = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":284
 * 
 *         s = Schema.__new__(Schema, schema_id)
 *         for space_row in spaces:             # <<<<<<<<<<<<<<
 *             sp = s.parse_space(space_row)
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)
 */
  if (likely(PyList_CheckExact(__pyx_v_spaces)) || PyTuple_CheckExact(__pyx_v_spaces)) {
    __pyx_t_1 = __pyx_v_spaces; __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_spaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 284, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_space_row, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":285
 *         s = Schema.__new__(Schema, schema_id)
 *         for space_row in spaces:
 *             sp = s.parse_space(space_row)             # <<<<<<<<<<<<<<
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)
 *             if sp.name:
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_s->__pyx_vtab)->parse_space(__pyx_v_s, __pyx_v_space_row)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_sp, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":286
 *         for space_row in spaces:
 *             sp = s.parse_space(space_row)
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)             # <<<<<<<<<<<<<<
 *             if sp.name:
 *                 cpython.dict.PyDict_SetItem(s.schema, sp.name, sp)
 */
    __pyx_t_2 = __pyx_v_s->schema;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_sp->sid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyDict_SetItem(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_v_sp)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asynctnt/iproto/schema.pyx":287
 *             sp = s.parse_space(space_row)
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)
 *             if sp.name:             # <<<<<<<<<<<<<<
 *                 cpython.dict.PyDict_SetItem(s.schema, sp.name, sp)
 * 
 */
    __pyx_t_7 = (__pyx_v_sp->name != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_sp->name) != 0);
    if (__pyx_t_7) {

      /* "asynctnt/iproto/schema.pyx":288
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)
 *             if sp.name:
 *                 cpython.dict.PyDict_SetItem(s.schema, sp.name, sp)             # <<<<<<<<<<<<<<
 * 
 *         for index_row in indexes:
 */
      __pyx_t_5 = __pyx_v_s->schema;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_2 = __pyx_v_sp->name;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_6 = PyDict_SetItem(__pyx_t_5, __pyx_t_2, ((PyObject *)__pyx_v_sp)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asynctnt/iproto/schema.pyx":287
 *             sp = s.parse_space(space_row)
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)
 *             if sp.name:             # <<<<<<<<<<<<<<
 *                 cpython.dict.PyDict_SetItem(s.schema, sp.name, sp)
 * 
 */
    }

    /* "asynctnt/iproto/schema.pyx":284
 * 
 *         s = Schema.__new__(Schema, schema_id)
 *         for space_row in spaces:             # <<<<<<<<<<<<<<
 *             sp = s.parse_space(space_row)
 *             cpython.dict.PyDict_SetItem(s.schema, sp.sid, sp)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":290
 *                 cpython.dict.PyDict_SetItem(s.schema, sp.name, sp)
 * 
 *         for index_row in indexes:             # <<<<<<<<<<<<<<
 *             idx = s.parse_index(index_row)
 *             sp = s.schema[idx.sid]
 */
  if (likely(PyList_CheckExact(__pyx_v_indexes)) || PyTuple_CheckExact(__pyx_v_indexes)) {
    __pyx_t_1 = __pyx_v_indexes; __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_indexes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 290, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_index_row, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":291
 * 
 *         for index_row in indexes:
 *             idx = s.parse_index(index_row)             # <<<<<<<<<<<<<<
 *             sp = s.schema[idx.sid]
 *             sp.add_index(idx)
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_s->__pyx_vtab)->parse_index(__pyx_v_s, __pyx_v_index_row)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_idx, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":292
 *         for index_row in indexes:
 *             idx = s.parse_index(index_row)
 *             sp = s.schema[idx.sid]             # <<<<<<<<<<<<<<
 *             sp.add_index(idx)
 * 
 */
    if (unlikely(__pyx_v_s->schema == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 292, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_idx->sid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_s->schema, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace))))) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_sp, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "asynctnt/iproto/schema.pyx":293
 *             idx = s.parse_index(index_row)
 *             sp = s.schema[idx.sid]
 *             sp.add_index(idx)             # <<<<<<<<<<<<<<
 * 
 *         return s
 */
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_sp->__pyx_vtab)->add_index(__pyx_v_sp, __pyx_v_idx);

    /* "asynctnt/iproto/schema.pyx":290
 *                 cpython.dict.PyDict_SetItem(s.schema, sp.name, sp)
 * 
 *         for index_row in indexes:             # <<<<<<<<<<<<<<
 *             idx = s.parse_index(index_row)
 *             sp = s.schema[idx.sid]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":295
 *             sp.add_index(idx)
 * 
 *         return s             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_s));
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":277
 * 
 *     @staticmethod
 *     cdef Schema parse(int64_t schema_id, spaces, indexes):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Schema s
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_s);
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_space_row);
  __Pyx_XDECREF(__pyx_v_index_row);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":297
 *         return s
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<Schema spaces={}>'.format(len(self.schema))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_6Schema_2__repr__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/schema.pyx":298
 * 
 *     def __repr__(self):
 *         return '<Schema spaces={}>'.format(len(self.schema))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Schema_spaces, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->schema;
  __Pyx_INCREF(__pyx_t_3);
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 298, __pyx_L1_error)
  }
  __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":297
 *         return s
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<Schema spaces={}>'.format(len(self.schema))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_6Schema_4__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6Schema_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_6Schema_6__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6Schema_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Schema.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/schema.pyx":301
 * 
 * 
 * cdef list dict_to_list_fields(dict d, TntFields fields, bint default_none):             # <<<<<<<<<<<<<<
 *     cdef:
 *         list tpl
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_dict_to_list_fields(PyObject *__pyx_v_d, struct C_TntFields *__pyx_v_fields, int __pyx_v_default_none) {
  PyObject *__pyx_v_tpl = 0;
  PyObject *__pyx_v_used = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_field_name = 0;
  int32_t __pyx_v_used_count;
  int __pyx_v_field_id;
  PyObject *__pyx_v_obj_p;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __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("dict_to_list_fields", 0);

  /* "asynctnt/iproto/schema.pyx":311
 *         PyObject *obj_p
 * 
 *     assert fields is not None             # <<<<<<<<<<<<<<
 *     assert d is not None
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = (((PyObject *)__pyx_v_fields) != Py_None);
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 311, __pyx_L1_error)
    }
  }
  #endif

  /* "asynctnt/iproto/schema.pyx":312
 * 
 *     assert fields is not None
 *     assert d is not None             # <<<<<<<<<<<<<<
 * 
 *     tpl = []
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = (__pyx_v_d != ((PyObject*)Py_None));
    if (unlikely(!(__pyx_t_1 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 312, __pyx_L1_error)
    }
  }
  #endif

  /* "asynctnt/iproto/schema.pyx":314
 *     assert d is not None
 * 
 *     tpl = []             # <<<<<<<<<<<<<<
 *     used_count = <int32_t>cpython.dict.PyDict_Size(d)
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_tpl = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":315
 * 
 *     tpl = []
 *     used_count = <int32_t>cpython.dict.PyDict_Size(d)             # <<<<<<<<<<<<<<
 * 
 *     for field_id in range(fields.len()):
 */
  __pyx_t_3 = PyDict_Size(__pyx_v_d); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 315, __pyx_L1_error)
  __pyx_v_used_count = ((int32_t)__pyx_t_3);

  /* "asynctnt/iproto/schema.pyx":317
 *     used_count = <int32_t>cpython.dict.PyDict_Size(d)
 * 
 *     for field_id in range(fields.len()):             # <<<<<<<<<<<<<<
 *         field_name = fields.name_by_id(field_id)
 * 
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(__pyx_v_fields);
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_field_id = __pyx_t_6;

    /* "asynctnt/iproto/schema.pyx":318
 * 
 *     for field_id in range(fields.len()):
 *         field_name = fields.name_by_id(field_id)             # <<<<<<<<<<<<<<
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(d, field_name)
 */
    __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(__pyx_v_fields, __pyx_v_field_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_field_name, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":320
 *         field_name = fields.name_by_id(field_id)
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(d, field_name)             # <<<<<<<<<<<<<<
 *         if obj_p is not NULL:
 *             value = <object>obj_p
 */
    __pyx_v_obj_p = PyDict_GetItem(__pyx_v_d, __pyx_v_field_name);

    /* "asynctnt/iproto/schema.pyx":321
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(d, field_name)
 *         if obj_p is not NULL:             # <<<<<<<<<<<<<<
 *             value = <object>obj_p
 *             used_count -= 1
 */
    __pyx_t_1 = ((__pyx_v_obj_p != NULL) != 0);
    if (__pyx_t_1) {

      /* "asynctnt/iproto/schema.pyx":322
 *         obj_p = cpython.dict.PyDict_GetItem(d, field_name)
 *         if obj_p is not NULL:
 *             value = <object>obj_p             # <<<<<<<<<<<<<<
 *             used_count -= 1
 *             tpl.append(value)
 */
      __pyx_t_2 = ((PyObject *)__pyx_v_obj_p);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "asynctnt/iproto/schema.pyx":323
 *         if obj_p is not NULL:
 *             value = <object>obj_p
 *             used_count -= 1             # <<<<<<<<<<<<<<
 *             tpl.append(value)
 *         else:
 */
      __pyx_v_used_count = (__pyx_v_used_count - 1);

      /* "asynctnt/iproto/schema.pyx":324
 *             value = <object>obj_p
 *             used_count -= 1
 *             tpl.append(value)             # <<<<<<<<<<<<<<
 *         else:
 *             if default_none:
 */
      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_tpl, __pyx_v_value); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 324, __pyx_L1_error)

      /* "asynctnt/iproto/schema.pyx":321
 * 
 *         obj_p = cpython.dict.PyDict_GetItem(d, field_name)
 *         if obj_p is not NULL:             # <<<<<<<<<<<<<<
 *             value = <object>obj_p
 *             used_count -= 1
 */
      goto __pyx_L5;
    }

    /* "asynctnt/iproto/schema.pyx":326
 *             tpl.append(value)
 *         else:
 *             if default_none:             # <<<<<<<<<<<<<<
 *                 tpl.append(None)
 * 
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_default_none != 0);
      if (__pyx_t_1) {

        /* "asynctnt/iproto/schema.pyx":327
 *         else:
 *             if default_none:
 *                 tpl.append(None)             # <<<<<<<<<<<<<<
 * 
 *     # Warn user if he used any of unknown fields
 */
        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_tpl, Py_None); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 327, __pyx_L1_error)

        /* "asynctnt/iproto/schema.pyx":326
 *             tpl.append(value)
 *         else:
 *             if default_none:             # <<<<<<<<<<<<<<
 *                 tpl.append(None)
 * 
 */
      }
    }
    __pyx_L5:;
  }

  /* "asynctnt/iproto/schema.pyx":330
 * 
 *     # Warn user if he used any of unknown fields
 *     if used_count != 0:             # <<<<<<<<<<<<<<
 *         used = {}
 *         for field_id in range(fields.len()):
 */
  __pyx_t_1 = ((__pyx_v_used_count != 0) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/schema.pyx":331
 *     # Warn user if he used any of unknown fields
 *     if used_count != 0:
 *         used = {}             # <<<<<<<<<<<<<<
 *         for field_id in range(fields.len()):
 *             field_name = fields.name_by_id(field_id)
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_used = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":332
 *     if used_count != 0:
 *         used = {}
 *         for field_id in range(fields.len()):             # <<<<<<<<<<<<<<
 *             field_name = fields.name_by_id(field_id)
 * 
 */
    __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len(__pyx_v_fields);
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_field_id = __pyx_t_6;

      /* "asynctnt/iproto/schema.pyx":333
 *         used = {}
 *         for field_id in range(fields.len()):
 *             field_name = fields.name_by_id(field_id)             # <<<<<<<<<<<<<<
 * 
 *             if <bint>cpython.dict.PyDict_Contains(d, field_name):
 */
      __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id(__pyx_v_fields, __pyx_v_field_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_field_name, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asynctnt/iproto/schema.pyx":335
 *             field_name = fields.name_by_id(field_id)
 * 
 *             if <bint>cpython.dict.PyDict_Contains(d, field_name):             # <<<<<<<<<<<<<<
 *                 used[field_name] = None
 *         if <bint>cpython.dict.PyDict_Contains(d, ''):
 */
      __pyx_t_8 = PyDict_Contains(__pyx_v_d, __pyx_v_field_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 335, __pyx_L1_error)
      __pyx_t_1 = ((__pyx_t_8 != 0) != 0);
      if (__pyx_t_1) {

        /* "asynctnt/iproto/schema.pyx":336
 * 
 *             if <bint>cpython.dict.PyDict_Contains(d, field_name):
 *                 used[field_name] = None             # <<<<<<<<<<<<<<
 *         if <bint>cpython.dict.PyDict_Contains(d, ''):
 *             used[''] = None
 */
        if (unlikely(PyDict_SetItem(__pyx_v_used, __pyx_v_field_name, Py_None) < 0)) __PYX_ERR(0, 336, __pyx_L1_error)

        /* "asynctnt/iproto/schema.pyx":335
 *             field_name = fields.name_by_id(field_id)
 * 
 *             if <bint>cpython.dict.PyDict_Contains(d, field_name):             # <<<<<<<<<<<<<<
 *                 used[field_name] = None
 *         if <bint>cpython.dict.PyDict_Contains(d, ''):
 */
      }
    }

    /* "asynctnt/iproto/schema.pyx":337
 *             if <bint>cpython.dict.PyDict_Contains(d, field_name):
 *                 used[field_name] = None
 *         if <bint>cpython.dict.PyDict_Contains(d, ''):             # <<<<<<<<<<<<<<
 *             used[''] = None
 * 
 */
    __pyx_t_4 = PyDict_Contains(__pyx_v_d, __pyx_kp_u__12); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 337, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_4 != 0) != 0);
    if (__pyx_t_1) {

      /* "asynctnt/iproto/schema.pyx":338
 *                 used[field_name] = None
 *         if <bint>cpython.dict.PyDict_Contains(d, ''):
 *             used[''] = None             # <<<<<<<<<<<<<<
 * 
 *         for f in d:
 */
      if (unlikely(PyDict_SetItem(__pyx_v_used, __pyx_kp_u__12, Py_None) < 0)) __PYX_ERR(0, 338, __pyx_L1_error)

      /* "asynctnt/iproto/schema.pyx":337
 *             if <bint>cpython.dict.PyDict_Contains(d, field_name):
 *                 used[field_name] = None
 *         if <bint>cpython.dict.PyDict_Contains(d, ''):             # <<<<<<<<<<<<<<
 *             used[''] = None
 * 
 */
    }

    /* "asynctnt/iproto/schema.pyx":340
 *             used[''] = None
 * 
 *         for f in d:             # <<<<<<<<<<<<<<
 *             if f not in used:
 *                 logger.warning(
 */
    __pyx_t_3 = 0;
    if (unlikely(__pyx_v_d == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 340, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_d, 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_10;
    __pyx_t_10 = 0;
    while (1) {
      __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_9, &__pyx_t_3, &__pyx_t_10, NULL, NULL, __pyx_t_4);
      if (unlikely(__pyx_t_5 == 0)) break;
      if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "asynctnt/iproto/schema.pyx":341
 * 
 *         for f in d:
 *             if f not in used:             # <<<<<<<<<<<<<<
 *                 logger.warning(
 *                     'Field \'%s\' in supplied dict is unknown as '
 */
      __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_f, __pyx_v_used, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
      __pyx_t_11 = (__pyx_t_1 != 0);
      if (__pyx_t_11) {

        /* "asynctnt/iproto/schema.pyx":342
 *         for f in d:
 *             if f not in used:
 *                 logger.warning(             # <<<<<<<<<<<<<<
 *                     'Field \'%s\' in supplied dict is unknown as '
 *                     'a tuple field for selected index. Skipping.',
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_warning); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "asynctnt/iproto/schema.pyx":345
 *                     'Field \'%s\' in supplied dict is unknown as '
 *                     'a tuple field for selected index. Skipping.',
 *                     f             # <<<<<<<<<<<<<<
 *                 )
 *     return tpl
 */
        __pyx_t_12 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_kp_u_Field_s_in_supplied_dict_is_unkn, __pyx_v_f};
          __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_kp_u_Field_s_in_supplied_dict_is_unkn, __pyx_v_f};
          __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
          }
          __Pyx_INCREF(__pyx_kp_u_Field_s_in_supplied_dict_is_unkn);
          __Pyx_GIVEREF(__pyx_kp_u_Field_s_in_supplied_dict_is_unkn);
          PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_kp_u_Field_s_in_supplied_dict_is_unkn);
          __Pyx_INCREF(__pyx_v_f);
          __Pyx_GIVEREF(__pyx_v_f);
          PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_v_f);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "asynctnt/iproto/schema.pyx":341
 * 
 *         for f in d:
 *             if f not in used:             # <<<<<<<<<<<<<<
 *                 logger.warning(
 *                     'Field \'%s\' in supplied dict is unknown as '
 */
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asynctnt/iproto/schema.pyx":330
 * 
 *     # Warn user if he used any of unknown fields
 *     if used_count != 0:             # <<<<<<<<<<<<<<
 *         used = {}
 *         for field_id in range(fields.len()):
 */
  }

  /* "asynctnt/iproto/schema.pyx":347
 *                     f
 *                 )
 *     return tpl             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tpl);
  __pyx_r = __pyx_v_tpl;
  goto __pyx_L0;

  /* "asynctnt/iproto/schema.pyx":301
 * 
 * 
 * cdef list dict_to_list_fields(dict d, TntFields fields, bint default_none):             # <<<<<<<<<<<<<<
 *     cdef:
 *         list tpl
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.dict_to_list_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tpl);
  __Pyx_XDECREF(__pyx_v_used);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_field_name);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":22
 * @cython.freelist(_BUFFER_FREELIST_SIZE)
 * cdef class WriteBuffer:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._smallbuf_inuse = True
 *         self._buf = self._smallbuf
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self));

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asynctnt/iproto/buffer.pyx":23
 * cdef class WriteBuffer:
 *     def __cinit__(self):
 *         self._smallbuf_inuse = True             # <<<<<<<<<<<<<<
 *         self._buf = self._smallbuf
 *         self._size = _BUFFER_INITIAL_SIZE
 */
  __pyx_v_self->_smallbuf_inuse = 1;

  /* "asynctnt/iproto/buffer.pyx":24
 *     def __cinit__(self):
 *         self._smallbuf_inuse = True
 *         self._buf = self._smallbuf             # <<<<<<<<<<<<<<
 *         self._size = _BUFFER_INITIAL_SIZE
 *         self._length = 0
 */
  __pyx_t_1 = __pyx_v_self->_smallbuf;
  __pyx_v_self->_buf = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":25
 *         self._smallbuf_inuse = True
 *         self._buf = self._smallbuf
 *         self._size = _BUFFER_INITIAL_SIZE             # <<<<<<<<<<<<<<
 *         self._length = 0
 *         self._encoding = None
 */
  __pyx_v_self->_size = 0x400;

  /* "asynctnt/iproto/buffer.pyx":26
 *         self._buf = self._smallbuf
 *         self._size = _BUFFER_INITIAL_SIZE
 *         self._length = 0             # <<<<<<<<<<<<<<
 *         self._encoding = None
 *         self.__op_offset = -1
 */
  __pyx_v_self->_length = 0;

  /* "asynctnt/iproto/buffer.pyx":27
 *         self._size = _BUFFER_INITIAL_SIZE
 *         self._length = 0
 *         self._encoding = None             # <<<<<<<<<<<<<<
 *         self.__op_offset = -1
 *         self.__sync_offset = -1
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_encoding);
  __Pyx_DECREF(__pyx_v_self->_encoding);
  __pyx_v_self->_encoding = ((PyObject*)Py_None);

  /* "asynctnt/iproto/buffer.pyx":28
 *         self._length = 0
 *         self._encoding = None
 *         self.__op_offset = -1             # <<<<<<<<<<<<<<
 *         self.__sync_offset = -1
 *         self.__schema_id_offset = -1
 */
  __pyx_v_self->__pyx___op_offset = -1L;

  /* "asynctnt/iproto/buffer.pyx":29
 *         self._encoding = None
 *         self.__op_offset = -1
 *         self.__sync_offset = -1             # <<<<<<<<<<<<<<
 *         self.__schema_id_offset = -1
 * 
 */
  __pyx_v_self->__pyx___sync_offset = -1L;

  /* "asynctnt/iproto/buffer.pyx":30
 *         self.__op_offset = -1
 *         self.__sync_offset = -1
 *         self.__schema_id_offset = -1             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->__pyx___schema_id_offset = -1L;

  /* "asynctnt/iproto/buffer.pyx":22
 * @cython.freelist(_BUFFER_FREELIST_SIZE)
 * cdef class WriteBuffer:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._smallbuf_inuse = True
 *         self._buf = self._smallbuf
 */

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

/* "asynctnt/iproto/buffer.pyx":32
 *         self.__schema_id_offset = -1
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._buf is not NULL and not self._smallbuf_inuse:
 *             PyMem_Free(self._buf)
 */

/* Python wrapper */
static void __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_2__dealloc__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self));

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

static void __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_2__dealloc__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "asynctnt/iproto/buffer.pyx":33
 * 
 *     def __dealloc__(self):
 *         if self._buf is not NULL and not self._smallbuf_inuse:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self._buf)
 *             self._buf = NULL
 */
  __pyx_t_2 = ((__pyx_v_self->_buf != NULL) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_self->_smallbuf_inuse != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":34
 *     def __dealloc__(self):
 *         if self._buf is not NULL and not self._smallbuf_inuse:
 *             PyMem_Free(self._buf)             # <<<<<<<<<<<<<<
 *             self._buf = NULL
 *             self._size = 0
 */
    PyMem_Free(__pyx_v_self->_buf);

    /* "asynctnt/iproto/buffer.pyx":35
 *         if self._buf is not NULL and not self._smallbuf_inuse:
 *             PyMem_Free(self._buf)
 *             self._buf = NULL             # <<<<<<<<<<<<<<
 *             self._size = 0
 * 
 */
    __pyx_v_self->_buf = NULL;

    /* "asynctnt/iproto/buffer.pyx":36
 *             PyMem_Free(self._buf)
 *             self._buf = NULL
 *             self._size = 0             # <<<<<<<<<<<<<<
 * 
 *         if self._view_count:
 */
    __pyx_v_self->_size = 0;

    /* "asynctnt/iproto/buffer.pyx":33
 * 
 *     def __dealloc__(self):
 *         if self._buf is not NULL and not self._smallbuf_inuse:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self._buf)
 *             self._buf = NULL
 */
  }

  /* "asynctnt/iproto/buffer.pyx":38
 *             self._size = 0
 * 
 *         if self._view_count:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 'Deallocating buffer with attached memoryviews')
 */
  __pyx_t_1 = (__pyx_v_self->_view_count != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/buffer.pyx":39
 * 
 *         if self._view_count:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 'Deallocating buffer with attached memoryviews')
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 39, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":38
 *             self._size = 0
 * 
 *         if self._view_count:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 'Deallocating buffer with attached memoryviews')
 */
  }

  /* "asynctnt/iproto/buffer.pyx":32
 *         self.__schema_id_offset = -1
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._buf is not NULL and not self._smallbuf_inuse:
 *             PyMem_Free(self._buf)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.WriteBuffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":42
 *                 'Deallocating buffer with attached memoryviews')
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         self._view_count += 1
 * 
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_4__getbuffer__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_4__getbuffer__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_v_buffer == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "asynctnt/iproto/buffer.pyx":43
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         self._view_count += 1             # <<<<<<<<<<<<<<
 * 
 *         cpython.PyBuffer_FillInfo(
 */
  __pyx_v_self->_view_count = (__pyx_v_self->_view_count + 1);

  /* "asynctnt/iproto/buffer.pyx":45
 *         self._view_count += 1
 * 
 *         cpython.PyBuffer_FillInfo(             # <<<<<<<<<<<<<<
 *             buffer, self, self._buf, self._length,
 *             1,  # read-only
 */
  __pyx_t_1 = PyBuffer_FillInfo(__pyx_v_buffer, ((PyObject *)__pyx_v_self), __pyx_v_self->_buf, __pyx_v_self->_length, 1, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 45, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":42
 *                 'Deallocating buffer with attached memoryviews')
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         self._view_count += 1
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_buffer->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":51
 *         )
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):             # <<<<<<<<<<<<<<
 *         self._view_count -= 1
 * 
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
static CYTHON_UNUSED void __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_6__releasebuffer__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer));

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

static void __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_6__releasebuffer__(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "asynctnt/iproto/buffer.pyx":52
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):
 *         self._view_count -= 1             # <<<<<<<<<<<<<<
 * 
 *     def hex(self):
 */
  __pyx_v_self->_view_count = (__pyx_v_self->_view_count - 1);

  /* "asynctnt/iproto/buffer.pyx":51
 *         )
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):             # <<<<<<<<<<<<<<
 *         self._view_count -= 1
 * 
 */

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

/* "asynctnt/iproto/buffer.pyx":54
 *         self._view_count -= 1
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))
 *                         for i in range(self._length))
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_9hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_9hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hex (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_8hex(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8asynctnt_6iproto_8protocol_11WriteBuffer_3hex_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asynctnt/iproto/buffer.pyx":55
 * 
 *     def hex(self):
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))             # <<<<<<<<<<<<<<
 *                         for i in range(self._length))
 * 
 */

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_3hex_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *)__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr(__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(2, 55, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8asynctnt_6iproto_8protocol_11WriteBuffer_3hex_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_hex_locals_genexpr, __pyx_n_s_asynctnt_iproto_protocol); if (unlikely(!gen)) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.hex.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8asynctnt_6iproto_8protocol_11WriteBuffer_3hex_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(2, 55, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);

  /* "asynctnt/iproto/buffer.pyx":56
 *     def hex(self):
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))
 *                         for i in range(self._length))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(2, 56, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->_length;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "asynctnt/iproto/buffer.pyx":55
 * 
 *     def hex(self):
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))             # <<<<<<<<<<<<<<
 *                         for i in range(self._length))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_02x, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(2, 55, __pyx_L1_error) }
    __pyx_t_6 = PyBytes_FromStringAndSize(&(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->_buf[__pyx_cur_scope->__pyx_v_i]), 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(2, 55, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":54
 *         self._view_count -= 1
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))
 *                         for i in range(self._length))
 */

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_8hex(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hex", 0);
  __pyx_cur_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *)__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex(__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(2, 54, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);

  /* "asynctnt/iproto/buffer.pyx":55
 * 
 *     def hex(self):
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))             # <<<<<<<<<<<<<<
 *                         for i in range(self._length))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_3hex_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__16, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":54
 *         self._view_count -= 1
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         return ":".join("{:02x}".format(ord(<bytes>(self._buf[i])))
 *                         for i in range(self._length))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":59
 * 
 *     @staticmethod
 *     cdef WriteBuffer new(bytes encoding):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.__new__(WriteBuffer)
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(PyObject *__pyx_v_encoding) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 0);

  /* "asynctnt/iproto/buffer.pyx":61
 *     cdef WriteBuffer new(bytes encoding):
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.__new__(WriteBuffer)             # <<<<<<<<<<<<<<
 *         buf._encoding = encoding
 *         return buf
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_WriteBuffer(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_WriteBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/buffer.pyx":62
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.__new__(WriteBuffer)
 *         buf._encoding = encoding             # <<<<<<<<<<<<<<
 *         return buf
 * 
 */
  __Pyx_INCREF(__pyx_v_encoding);
  __Pyx_GIVEREF(__pyx_v_encoding);
  __Pyx_GOTREF(__pyx_v_buf->_encoding);
  __Pyx_DECREF(__pyx_v_buf->_encoding);
  __pyx_v_buf->_encoding = __pyx_v_encoding;

  /* "asynctnt/iproto/buffer.pyx":63
 *         buf = WriteBuffer.__new__(WriteBuffer)
 *         buf._encoding = encoding
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_readonly(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_buf));
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":59
 * 
 *     @staticmethod
 *     cdef WriteBuffer new(bytes encoding):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.__new__(WriteBuffer)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":65
 *         return buf
 * 
 *     cdef inline _check_readonly(self):             # <<<<<<<<<<<<<<
 *         if self._view_count:
 *             raise BufferError('the buffer is in read-only mode')
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__check_readonly(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_readonly", 0);

  /* "asynctnt/iproto/buffer.pyx":66
 * 
 *     cdef inline _check_readonly(self):
 *         if self._view_count:             # <<<<<<<<<<<<<<
 *             raise BufferError('the buffer is in read-only mode')
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_view_count != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/buffer.pyx":67
 *     cdef inline _check_readonly(self):
 *         if self._view_count:
 *             raise BufferError('the buffer is in read-only mode')             # <<<<<<<<<<<<<<
 * 
 *     cdef inline len(self):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_BufferError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 67, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":66
 * 
 *     cdef inline _check_readonly(self):
 *         if self._view_count:             # <<<<<<<<<<<<<<
 *             raise BufferError('the buffer is in read-only mode')
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":65
 *         return buf
 * 
 *     cdef inline _check_readonly(self):             # <<<<<<<<<<<<<<
 *         if self._view_count:
 *             raise BufferError('the buffer is in read-only mode')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._check_readonly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":69
 *             raise BufferError('the buffer is in read-only mode')
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_len(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("len", 0);

  /* "asynctnt/iproto/buffer.pyx":70
 * 
 *     cdef inline len(self):
 *         return self._length             # <<<<<<<<<<<<<<
 * 
 *     cdef void ensure_allocated(self, ssize_t extra_length) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":69
 *             raise BufferError('the buffer is in read-only mode')
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":72
 *         return self._length
 * 
 *     cdef void ensure_allocated(self, ssize_t extra_length) except *:             # <<<<<<<<<<<<<<
 *         cdef ssize_t new_size = extra_length + self._length
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_extra_length) {
  Py_ssize_t __pyx_v_new_size;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ensure_allocated", 0);

  /* "asynctnt/iproto/buffer.pyx":73
 * 
 *     cdef void ensure_allocated(self, ssize_t extra_length) except *:
 *         cdef ssize_t new_size = extra_length + self._length             # <<<<<<<<<<<<<<
 * 
 *         if new_size > self._size:
 */
  __pyx_v_new_size = (__pyx_v_extra_length + __pyx_v_self->_length);

  /* "asynctnt/iproto/buffer.pyx":75
 *         cdef ssize_t new_size = extra_length + self._length
 * 
 *         if new_size > self._size:             # <<<<<<<<<<<<<<
 *             self._reallocate(new_size)
 * 
 */
  __pyx_t_1 = ((__pyx_v_new_size > __pyx_v_self->_size) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":76
 * 
 *         if new_size > self._size:
 *             self._reallocate(new_size)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_ensure_allocated(self, char *p,
 */
    __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__reallocate(__pyx_v_self, __pyx_v_new_size); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 76, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":75
 *         cdef ssize_t new_size = extra_length + self._length
 * 
 *         if new_size > self._size:             # <<<<<<<<<<<<<<
 *             self._reallocate(new_size)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":72
 *         return self._length
 * 
 *     cdef void ensure_allocated(self, ssize_t extra_length) except *:             # <<<<<<<<<<<<<<
 *         cdef ssize_t new_size = extra_length + self._length
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.ensure_allocated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":78
 *             self._reallocate(new_size)
 * 
 *     cdef char *_ensure_allocated(self, char *p,             # <<<<<<<<<<<<<<
 *                                  ssize_t extra_length) except NULL:
 *         cdef:
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, Py_ssize_t __pyx_v_extra_length) {
  Py_ssize_t __pyx_v_new_size;
  ptrdiff_t __pyx_v_used;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_allocated", 0);

  /* "asynctnt/iproto/buffer.pyx":83
 *             ssize_t new_size
 * 
 *         new_size = extra_length + self._length             # <<<<<<<<<<<<<<
 * 
 *         if new_size > self._size:
 */
  __pyx_v_new_size = (__pyx_v_extra_length + __pyx_v_self->_length);

  /* "asynctnt/iproto/buffer.pyx":85
 *         new_size = extra_length + self._length
 * 
 *         if new_size > self._size:             # <<<<<<<<<<<<<<
 *             used = p - self._buf
 *             self._reallocate(new_size)
 */
  __pyx_t_1 = ((__pyx_v_new_size > __pyx_v_self->_size) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":86
 * 
 *         if new_size > self._size:
 *             used = p - self._buf             # <<<<<<<<<<<<<<
 *             self._reallocate(new_size)
 *             p = &self._buf[used]
 */
    __pyx_v_used = (__pyx_v_p - __pyx_v_self->_buf);

    /* "asynctnt/iproto/buffer.pyx":87
 *         if new_size > self._size:
 *             used = p - self._buf
 *             self._reallocate(new_size)             # <<<<<<<<<<<<<<
 *             p = &self._buf[used]
 *         return p
 */
    __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__reallocate(__pyx_v_self, __pyx_v_new_size); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 87, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":88
 *             used = p - self._buf
 *             self._reallocate(new_size)
 *             p = &self._buf[used]             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
    __pyx_v_p = (&(__pyx_v_self->_buf[__pyx_v_used]));

    /* "asynctnt/iproto/buffer.pyx":85
 *         new_size = extra_length + self._length
 * 
 *         if new_size > self._size:             # <<<<<<<<<<<<<<
 *             used = p - self._buf
 *             self._reallocate(new_size)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":89
 *             self._reallocate(new_size)
 *             p = &self._buf[used]
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef void _reallocate(self, ssize_t new_size) except *:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":78
 *             self._reallocate(new_size)
 * 
 *     cdef char *_ensure_allocated(self, char *p,             # <<<<<<<<<<<<<<
 *                                  ssize_t extra_length) except NULL:
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._ensure_allocated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":91
 *         return p
 * 
 *     cdef void _reallocate(self, ssize_t new_size) except *:             # <<<<<<<<<<<<<<
 *         cdef char *new_buf
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__reallocate(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_new_size) {
  char *__pyx_v_new_buf;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reallocate", 0);

  /* "asynctnt/iproto/buffer.pyx":94
 *         cdef char *new_buf
 * 
 *         if new_size < _BUFFER_MAX_GROW:             # <<<<<<<<<<<<<<
 *             new_size = _BUFFER_MAX_GROW
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_new_size < 0x10000) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":95
 * 
 *         if new_size < _BUFFER_MAX_GROW:
 *             new_size = _BUFFER_MAX_GROW             # <<<<<<<<<<<<<<
 *         else:
 *             # Add a little extra
 */
    __pyx_v_new_size = 0x10000;

    /* "asynctnt/iproto/buffer.pyx":94
 *         cdef char *new_buf
 * 
 *         if new_size < _BUFFER_MAX_GROW:             # <<<<<<<<<<<<<<
 *             new_size = _BUFFER_MAX_GROW
 *         else:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/buffer.pyx":98
 *         else:
 *             # Add a little extra
 *             new_size += _BUFFER_INITIAL_SIZE             # <<<<<<<<<<<<<<
 * 
 *         if self._smallbuf_inuse:
 */
  /*else*/ {
    __pyx_v_new_size = (__pyx_v_new_size + 0x400);
  }
  __pyx_L3:;

  /* "asynctnt/iproto/buffer.pyx":100
 *             new_size += _BUFFER_INITIAL_SIZE
 * 
 *         if self._smallbuf_inuse:             # <<<<<<<<<<<<<<
 *             new_buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>new_size)
 *             if new_buf is NULL:
 */
  __pyx_t_1 = (__pyx_v_self->_smallbuf_inuse != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":101
 * 
 *         if self._smallbuf_inuse:
 *             new_buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>new_size)             # <<<<<<<<<<<<<<
 *             if new_buf is NULL:
 *                 self._buf = NULL
 */
    __pyx_v_new_buf = ((char *)PyMem_Malloc(((sizeof(char)) * ((size_t)__pyx_v_new_size))));

    /* "asynctnt/iproto/buffer.pyx":102
 *         if self._smallbuf_inuse:
 *             new_buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>new_size)
 *             if new_buf is NULL:             # <<<<<<<<<<<<<<
 *                 self._buf = NULL
 *                 self._size = 0
 */
    __pyx_t_1 = ((__pyx_v_new_buf == NULL) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/buffer.pyx":103
 *             new_buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>new_size)
 *             if new_buf is NULL:
 *                 self._buf = NULL             # <<<<<<<<<<<<<<
 *                 self._size = 0
 *                 self._length = 0
 */
      __pyx_v_self->_buf = NULL;

      /* "asynctnt/iproto/buffer.pyx":104
 *             if new_buf is NULL:
 *                 self._buf = NULL
 *                 self._size = 0             # <<<<<<<<<<<<<<
 *                 self._length = 0
 *                 raise MemoryError
 */
      __pyx_v_self->_size = 0;

      /* "asynctnt/iproto/buffer.pyx":105
 *                 self._buf = NULL
 *                 self._size = 0
 *                 self._length = 0             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             memcpy(new_buf, self._buf, <size_t>self._size)
 */
      __pyx_v_self->_length = 0;

      /* "asynctnt/iproto/buffer.pyx":106
 *                 self._size = 0
 *                 self._length = 0
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             memcpy(new_buf, self._buf, <size_t>self._size)
 *             self._size = new_size
 */
      PyErr_NoMemory(); __PYX_ERR(2, 106, __pyx_L1_error)

      /* "asynctnt/iproto/buffer.pyx":102
 *         if self._smallbuf_inuse:
 *             new_buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>new_size)
 *             if new_buf is NULL:             # <<<<<<<<<<<<<<
 *                 self._buf = NULL
 *                 self._size = 0
 */
    }

    /* "asynctnt/iproto/buffer.pyx":107
 *                 self._length = 0
 *                 raise MemoryError
 *             memcpy(new_buf, self._buf, <size_t>self._size)             # <<<<<<<<<<<<<<
 *             self._size = new_size
 *             self._buf = new_buf
 */
    (void)(memcpy(__pyx_v_new_buf, __pyx_v_self->_buf, ((size_t)__pyx_v_self->_size)));

    /* "asynctnt/iproto/buffer.pyx":108
 *                 raise MemoryError
 *             memcpy(new_buf, self._buf, <size_t>self._size)
 *             self._size = new_size             # <<<<<<<<<<<<<<
 *             self._buf = new_buf
 *             self._smallbuf_inuse = False
 */
    __pyx_v_self->_size = __pyx_v_new_size;

    /* "asynctnt/iproto/buffer.pyx":109
 *             memcpy(new_buf, self._buf, <size_t>self._size)
 *             self._size = new_size
 *             self._buf = new_buf             # <<<<<<<<<<<<<<
 *             self._smallbuf_inuse = False
 *         else:
 */
    __pyx_v_self->_buf = __pyx_v_new_buf;

    /* "asynctnt/iproto/buffer.pyx":110
 *             self._size = new_size
 *             self._buf = new_buf
 *             self._smallbuf_inuse = False             # <<<<<<<<<<<<<<
 *         else:
 *             new_buf = <char*>PyMem_Realloc(<void*>self._buf, <size_t>new_size)
 */
    __pyx_v_self->_smallbuf_inuse = 0;

    /* "asynctnt/iproto/buffer.pyx":100
 *             new_size += _BUFFER_INITIAL_SIZE
 * 
 *         if self._smallbuf_inuse:             # <<<<<<<<<<<<<<
 *             new_buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>new_size)
 *             if new_buf is NULL:
 */
    goto __pyx_L4;
  }

  /* "asynctnt/iproto/buffer.pyx":112
 *             self._smallbuf_inuse = False
 *         else:
 *             new_buf = <char*>PyMem_Realloc(<void*>self._buf, <size_t>new_size)             # <<<<<<<<<<<<<<
 *             if new_buf is NULL:
 *                 PyMem_Free(self._buf)
 */
  /*else*/ {
    __pyx_v_new_buf = ((char *)PyMem_Realloc(((void *)__pyx_v_self->_buf), ((size_t)__pyx_v_new_size)));

    /* "asynctnt/iproto/buffer.pyx":113
 *         else:
 *             new_buf = <char*>PyMem_Realloc(<void*>self._buf, <size_t>new_size)
 *             if new_buf is NULL:             # <<<<<<<<<<<<<<
 *                 PyMem_Free(self._buf)
 *                 self._buf = NULL
 */
    __pyx_t_1 = ((__pyx_v_new_buf == NULL) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/buffer.pyx":114
 *             new_buf = <char*>PyMem_Realloc(<void*>self._buf, <size_t>new_size)
 *             if new_buf is NULL:
 *                 PyMem_Free(self._buf)             # <<<<<<<<<<<<<<
 *                 self._buf = NULL
 *                 self._size = 0
 */
      PyMem_Free(__pyx_v_self->_buf);

      /* "asynctnt/iproto/buffer.pyx":115
 *             if new_buf is NULL:
 *                 PyMem_Free(self._buf)
 *                 self._buf = NULL             # <<<<<<<<<<<<<<
 *                 self._size = 0
 *                 self._length = 0
 */
      __pyx_v_self->_buf = NULL;

      /* "asynctnt/iproto/buffer.pyx":116
 *                 PyMem_Free(self._buf)
 *                 self._buf = NULL
 *                 self._size = 0             # <<<<<<<<<<<<<<
 *                 self._length = 0
 *                 raise MemoryError
 */
      __pyx_v_self->_size = 0;

      /* "asynctnt/iproto/buffer.pyx":117
 *                 self._buf = NULL
 *                 self._size = 0
 *                 self._length = 0             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             self._buf = new_buf
 */
      __pyx_v_self->_length = 0;

      /* "asynctnt/iproto/buffer.pyx":118
 *                 self._size = 0
 *                 self._length = 0
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             self._buf = new_buf
 *             self._size = new_size
 */
      PyErr_NoMemory(); __PYX_ERR(2, 118, __pyx_L1_error)

      /* "asynctnt/iproto/buffer.pyx":113
 *         else:
 *             new_buf = <char*>PyMem_Realloc(<void*>self._buf, <size_t>new_size)
 *             if new_buf is NULL:             # <<<<<<<<<<<<<<
 *                 PyMem_Free(self._buf)
 *                 self._buf = NULL
 */
    }

    /* "asynctnt/iproto/buffer.pyx":119
 *                 self._length = 0
 *                 raise MemoryError
 *             self._buf = new_buf             # <<<<<<<<<<<<<<
 *             self._size = new_size
 * 
 */
    __pyx_v_self->_buf = __pyx_v_new_buf;

    /* "asynctnt/iproto/buffer.pyx":120
 *                 raise MemoryError
 *             self._buf = new_buf
 *             self._size = new_size             # <<<<<<<<<<<<<<
 * 
 *     cdef void write_buffer(self, WriteBuffer buf) except *:
 */
    __pyx_v_self->_size = __pyx_v_new_size;
  }
  __pyx_L4:;

  /* "asynctnt/iproto/buffer.pyx":91
 *         return p
 * 
 *     cdef void _reallocate(self, ssize_t new_size) except *:             # <<<<<<<<<<<<<<
 *         cdef char *new_buf
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._reallocate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":122
 *             self._size = new_size
 * 
 *     cdef void write_buffer(self, WriteBuffer buf) except *:             # <<<<<<<<<<<<<<
 *         if not buf._length:
 *             return
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_buffer(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_buffer", 0);

  /* "asynctnt/iproto/buffer.pyx":123
 * 
 *     cdef void write_buffer(self, WriteBuffer buf) except *:
 *         if not buf._length:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_buf->_length != 0)) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":124
 *     cdef void write_buffer(self, WriteBuffer buf) except *:
 *         if not buf._length:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(buf._length)
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":123
 * 
 *     cdef void write_buffer(self, WriteBuffer buf) except *:
 *         if not buf._length:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":126
 *             return
 * 
 *         self.ensure_allocated(buf._length)             # <<<<<<<<<<<<<<
 *         memcpy(self._buf + self._length,
 *                <void*>buf._buf,
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_buf->_length); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 126, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":127
 * 
 *         self.ensure_allocated(buf._length)
 *         memcpy(self._buf + self._length,             # <<<<<<<<<<<<<<
 *                <void*>buf._buf,
 *                <size_t>buf._length)
 */
  (void)(memcpy((__pyx_v_self->_buf + __pyx_v_self->_length), ((void *)__pyx_v_buf->_buf), ((size_t)__pyx_v_buf->_length)));

  /* "asynctnt/iproto/buffer.pyx":130
 *                <void*>buf._buf,
 *                <size_t>buf._length)
 *         self._length += buf._length             # <<<<<<<<<<<<<<
 * 
 *     cdef void write_header(self, uint64_t sync,
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + __pyx_v_buf->_length);

  /* "asynctnt/iproto/buffer.pyx":122
 *             self._size = new_size
 * 
 *     cdef void write_buffer(self, WriteBuffer buf) except *:             # <<<<<<<<<<<<<<
 *         if not buf._length:
 *             return
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.write_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":132
 *         self._length += buf._length
 * 
 *     cdef void write_header(self, uint64_t sync,             # <<<<<<<<<<<<<<
 *                            tarantool.iproto_type op,
 *                            int64_t schema_id) except *:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, uint64_t __pyx_v_sync, enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op, int64_t __pyx_v_schema_id) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_map_size;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_header", 0);

  /* "asynctnt/iproto/buffer.pyx":136
 *                            int64_t schema_id) except *:
 *         cdef:
 *             char *begin = NULL             # <<<<<<<<<<<<<<
 *             char *p = NULL
 *             uint32_t map_size
 */
  __pyx_v_begin = NULL;

  /* "asynctnt/iproto/buffer.pyx":137
 *         cdef:
 *             char *begin = NULL
 *             char *p = NULL             # <<<<<<<<<<<<<<
 *             uint32_t map_size
 *         self.ensure_allocated(HEADER_CONST_LEN)
 */
  __pyx_v_p = NULL;

  /* "asynctnt/iproto/buffer.pyx":139
 *             char *p = NULL
 *             uint32_t map_size
 *         self.ensure_allocated(HEADER_CONST_LEN)             # <<<<<<<<<<<<<<
 * 
 *         map_size = 2 + <uint32_t>(schema_id > 0)
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, 24); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":141
 *         self.ensure_allocated(HEADER_CONST_LEN)
 * 
 *         map_size = 2 + <uint32_t>(schema_id > 0)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_v_map_size = (2 + ((uint32_t)(__pyx_v_schema_id > 0)));

  /* "asynctnt/iproto/buffer.pyx":143
 *         map_size = 2 + <uint32_t>(schema_id > 0)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(&p[5], map_size)
 *         p = mp_encode_uint(p, tarantool.IPROTO_REQUEST_TYPE)
 */
  __pyx_t_1 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":144
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(&p[5], map_size)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_REQUEST_TYPE)
 *         self.__op_offset = (p - begin)  # save op position
 */
  __pyx_v_p = mp_encode_map((&(__pyx_v_p[5])), __pyx_v_map_size);

  /* "asynctnt/iproto/buffer.pyx":145
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(&p[5], map_size)
 *         p = mp_encode_uint(p, tarantool.IPROTO_REQUEST_TYPE)             # <<<<<<<<<<<<<<
 *         self.__op_offset = (p - begin)  # save op position
 *         p = mp_encode_uint(p, <uint32_t>op)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_REQUEST_TYPE);

  /* "asynctnt/iproto/buffer.pyx":146
 *         p = mp_encode_map(&p[5], map_size)
 *         p = mp_encode_uint(p, tarantool.IPROTO_REQUEST_TYPE)
 *         self.__op_offset = (p - begin)  # save op position             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, <uint32_t>op)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SYNC)
 */
  __pyx_v_self->__pyx___op_offset = (__pyx_v_p - __pyx_v_begin);

  /* "asynctnt/iproto/buffer.pyx":147
 *         p = mp_encode_uint(p, tarantool.IPROTO_REQUEST_TYPE)
 *         self.__op_offset = (p - begin)  # save op position
 *         p = mp_encode_uint(p, <uint32_t>op)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_SYNC)
 *         self.__sync_offset = (p - begin)  # save sync position
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, ((uint32_t)__pyx_v_op));

  /* "asynctnt/iproto/buffer.pyx":148
 *         self.__op_offset = (p - begin)  # save op position
 *         p = mp_encode_uint(p, <uint32_t>op)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SYNC)             # <<<<<<<<<<<<<<
 *         self.__sync_offset = (p - begin)  # save sync position
 *         p = mp_encode_uint(p, sync)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SYNC);

  /* "asynctnt/iproto/buffer.pyx":149
 *         p = mp_encode_uint(p, <uint32_t>op)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SYNC)
 *         self.__sync_offset = (p - begin)  # save sync position             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, sync)
 * 
 */
  __pyx_v_self->__pyx___sync_offset = (__pyx_v_p - __pyx_v_begin);

  /* "asynctnt/iproto/buffer.pyx":150
 *         p = mp_encode_uint(p, tarantool.IPROTO_SYNC)
 *         self.__sync_offset = (p - begin)  # save sync position
 *         p = mp_encode_uint(p, sync)             # <<<<<<<<<<<<<<
 * 
 *         if schema_id > 0:
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_sync);

  /* "asynctnt/iproto/buffer.pyx":152
 *         p = mp_encode_uint(p, sync)
 * 
 *         if schema_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_SCHEMA_VERSION)
 *             p = mp_store_u8(p, 0xce)
 */
  __pyx_t_2 = ((__pyx_v_schema_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":153
 * 
 *         if schema_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_SCHEMA_VERSION)             # <<<<<<<<<<<<<<
 *             p = mp_store_u8(p, 0xce)
 *             self.__schema_id_offset = (p - begin)  # save schema_id position
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SCHEMA_VERSION);

    /* "asynctnt/iproto/buffer.pyx":154
 *         if schema_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_SCHEMA_VERSION)
 *             p = mp_store_u8(p, 0xce)             # <<<<<<<<<<<<<<
 *             self.__schema_id_offset = (p - begin)  # save schema_id position
 *             p = mp_store_u32(p, schema_id)
 */
    __pyx_v_p = mp_store_u8(__pyx_v_p, 0xce);

    /* "asynctnt/iproto/buffer.pyx":155
 *             p = mp_encode_uint(p, tarantool.IPROTO_SCHEMA_VERSION)
 *             p = mp_store_u8(p, 0xce)
 *             self.__schema_id_offset = (p - begin)  # save schema_id position             # <<<<<<<<<<<<<<
 *             p = mp_store_u32(p, schema_id)
 * 
 */
    __pyx_v_self->__pyx___schema_id_offset = (__pyx_v_p - __pyx_v_begin);

    /* "asynctnt/iproto/buffer.pyx":156
 *             p = mp_store_u8(p, 0xce)
 *             self.__schema_id_offset = (p - begin)  # save schema_id position
 *             p = mp_store_u32(p, schema_id)             # <<<<<<<<<<<<<<
 * 
 *         self._length += (p - begin)
 */
    __pyx_v_p = mp_store_u32(__pyx_v_p, __pyx_v_schema_id);

    /* "asynctnt/iproto/buffer.pyx":152
 *         p = mp_encode_uint(p, sync)
 * 
 *         if schema_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_SCHEMA_VERSION)
 *             p = mp_store_u8(p, 0xce)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":158
 *             p = mp_store_u32(p, schema_id)
 * 
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 * 
 *     cdef void change_schema_id(self, int64_t new_schema_id):
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":132
 *         self._length += buf._length
 * 
 *     cdef void write_header(self, uint64_t sync,             # <<<<<<<<<<<<<<
 *                            tarantool.iproto_type op,
 *                            int64_t schema_id) except *:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":160
 *         self._length += (p - begin)
 * 
 *     cdef void change_schema_id(self, int64_t new_schema_id):             # <<<<<<<<<<<<<<
 *         cdef char *p
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_change_schema_id(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, int64_t __pyx_v_new_schema_id) {
  char *__pyx_v_p;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("change_schema_id", 0);

  /* "asynctnt/iproto/buffer.pyx":163
 *         cdef char *p
 * 
 *         if self.__schema_id_offset > 0 and new_schema_id > 0:             # <<<<<<<<<<<<<<
 *             p = &self._buf[self.__schema_id_offset]
 *             p = mp_store_u32(p, new_schema_id)
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx___schema_id_offset > 0) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_new_schema_id > 0) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":164
 * 
 *         if self.__schema_id_offset > 0 and new_schema_id > 0:
 *             p = &self._buf[self.__schema_id_offset]             # <<<<<<<<<<<<<<
 *             p = mp_store_u32(p, new_schema_id)
 * 
 */
    __pyx_v_p = (&(__pyx_v_self->_buf[__pyx_v_self->__pyx___schema_id_offset]));

    /* "asynctnt/iproto/buffer.pyx":165
 *         if self.__schema_id_offset > 0 and new_schema_id > 0:
 *             p = &self._buf[self.__schema_id_offset]
 *             p = mp_store_u32(p, new_schema_id)             # <<<<<<<<<<<<<<
 * 
 *     cdef void write_length(self):
 */
    __pyx_v_p = mp_store_u32(__pyx_v_p, __pyx_v_new_schema_id);

    /* "asynctnt/iproto/buffer.pyx":163
 *         cdef char *p
 * 
 *         if self.__schema_id_offset > 0 and new_schema_id > 0:             # <<<<<<<<<<<<<<
 *             p = &self._buf[self.__schema_id_offset]
 *             p = mp_store_u32(p, new_schema_id)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":160
 *         self._length += (p - begin)
 * 
 *     cdef void change_schema_id(self, int64_t new_schema_id):             # <<<<<<<<<<<<<<
 *         cdef char *p
 * 
 */

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

/* "asynctnt/iproto/buffer.pyx":167
 *             p = mp_store_u32(p, new_schema_id)
 * 
 *     cdef void write_length(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *p
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  char *__pyx_v_p;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  __Pyx_RefNannySetupContext("write_length", 0);

  /* "asynctnt/iproto/buffer.pyx":170
 *         cdef:
 *             char *p
 *         p = self._buf             # <<<<<<<<<<<<<<
 *         p = mp_store_u8(p, 0xce)
 *         p = mp_store_u32(p, self._length - 5)
 */
  __pyx_t_1 = __pyx_v_self->_buf;
  __pyx_v_p = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":171
 *             char *p
 *         p = self._buf
 *         p = mp_store_u8(p, 0xce)             # <<<<<<<<<<<<<<
 *         p = mp_store_u32(p, self._length - 5)
 * 
 */
  __pyx_v_p = mp_store_u8(__pyx_v_p, 0xce);

  /* "asynctnt/iproto/buffer.pyx":172
 *         p = self._buf
 *         p = mp_store_u8(p, 0xce)
 *         p = mp_store_u32(p, self._length - 5)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_nil(self, char *p) except NULL:
 */
  __pyx_v_p = mp_store_u32(__pyx_v_p, (__pyx_v_self->_length - 5));

  /* "asynctnt/iproto/buffer.pyx":167
 *             p = mp_store_u32(p, new_schema_id)
 * 
 *     cdef void write_length(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *p
 */

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

/* "asynctnt/iproto/buffer.pyx":174
 *         p = mp_store_u32(p, self._length - 5)
 * 
 *     cdef char *_encode_nil(self, char *p) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_nil(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_nil", 0);

  /* "asynctnt/iproto/buffer.pyx":176
 *     cdef char *_encode_nil(self, char *p) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)             # <<<<<<<<<<<<<<
 *         p = mp_encode_nil(p)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, 1); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 176, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":177
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)
 *         p = mp_encode_nil(p)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_nil(__pyx_v_p);

  /* "asynctnt/iproto/buffer.pyx":178
 *         p = begin = self._ensure_allocated(p, 1)
 *         p = mp_encode_nil(p)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":179
 *         p = mp_encode_nil(p)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_bool(self, char *p, bint value) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":174
 *         p = mp_store_u32(p, self._length - 5)
 * 
 *     cdef char *_encode_nil(self, char *p) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_nil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":181
 *         return p
 * 
 *     cdef char *_encode_bool(self, char *p, bint value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bool(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, int __pyx_v_value) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_bool", 0);

  /* "asynctnt/iproto/buffer.pyx":183
 *     cdef char *_encode_bool(self, char *p, bint value) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)             # <<<<<<<<<<<<<<
 *         p = mp_encode_bool(p, value)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, 1); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 183, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":184
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)
 *         p = mp_encode_bool(p, value)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_bool(__pyx_v_p, __pyx_v_value);

  /* "asynctnt/iproto/buffer.pyx":185
 *         p = begin = self._ensure_allocated(p, 1)
 *         p = mp_encode_bool(p, value)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":186
 *         p = mp_encode_bool(p, value)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_double(self, char *p, double value) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":181
 *         return p
 * 
 *     cdef char *_encode_bool(self, char *p, bint value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, 1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":188
 *         return p
 * 
 *     cdef char *_encode_double(self, char *p, double value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_double(value))
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_double(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, double __pyx_v_value) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_double", 0);

  /* "asynctnt/iproto/buffer.pyx":190
 *     cdef char *_encode_double(self, char *p, double value) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_double(value))             # <<<<<<<<<<<<<<
 *         p = mp_encode_double(p, value)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_double(__pyx_v_value)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 190, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":191
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_double(value))
 *         p = mp_encode_double(p, value)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_double(__pyx_v_p, __pyx_v_value);

  /* "asynctnt/iproto/buffer.pyx":192
 *         p = begin = self._ensure_allocated(p, mp_sizeof_double(value))
 *         p = mp_encode_double(p, value)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":193
 *         p = mp_encode_double(p, value)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_uint(self, char *p, uint64_t value) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":188
 *         return p
 * 
 *     cdef char *_encode_double(self, char *p, double value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_double(value))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":195
 *         return p
 * 
 *     cdef char *_encode_uint(self, char *p, uint64_t value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_uint(value))
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, uint64_t __pyx_v_value) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_uint", 0);

  /* "asynctnt/iproto/buffer.pyx":197
 *     cdef char *_encode_uint(self, char *p, uint64_t value) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_uint(value))             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, value)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_uint(__pyx_v_value)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 197, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":198
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_uint(value))
 *         p = mp_encode_uint(p, value)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_value);

  /* "asynctnt/iproto/buffer.pyx":199
 *         p = begin = self._ensure_allocated(p, mp_sizeof_uint(value))
 *         p = mp_encode_uint(p, value)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":200
 *         p = mp_encode_uint(p, value)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_int(self, char *p, int64_t value) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":195
 *         return p
 * 
 *     cdef char *_encode_uint(self, char *p, uint64_t value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_uint(value))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_uint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":202
 *         return p
 * 
 *     cdef char *_encode_int(self, char *p, int64_t value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_int(value))
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_int(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, int64_t __pyx_v_value) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_int", 0);

  /* "asynctnt/iproto/buffer.pyx":204
 *     cdef char *_encode_int(self, char *p, int64_t value) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_int(value))             # <<<<<<<<<<<<<<
 *         p = mp_encode_int(p, value)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_int(__pyx_v_value)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 204, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":205
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_int(value))
 *         p = mp_encode_int(p, value)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_int(__pyx_v_p, __pyx_v_value);

  /* "asynctnt/iproto/buffer.pyx":206
 *         p = begin = self._ensure_allocated(p, mp_sizeof_int(value))
 *         p = mp_encode_int(p, value)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":207
 *         p = mp_encode_int(p, value)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_str(self, char *p,
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":202
 *         return p
 * 
 *     cdef char *_encode_int(self, char *p, int64_t value) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_int(value))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":209
 *         return p
 * 
 *     cdef char *_encode_str(self, char *p,             # <<<<<<<<<<<<<<
 *                            const char *str, uint32_t len) except NULL:
 *         cdef char *begin
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_str(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, char const *__pyx_v_str, uint32_t __pyx_v_len) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_str", 0);

  /* "asynctnt/iproto/buffer.pyx":212
 *                            const char *str, uint32_t len) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_str(len))             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, str, len)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_str(__pyx_v_len)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 212, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":213
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_str(len))
 *         p = mp_encode_str(p, str, len)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_str, __pyx_v_len);

  /* "asynctnt/iproto/buffer.pyx":214
 *         p = begin = self._ensure_allocated(p, mp_sizeof_str(len))
 *         p = mp_encode_str(p, str, len)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":215
 *         p = mp_encode_str(p, str, len)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_bin(self, char *p,
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":209
 *         return p
 * 
 *     cdef char *_encode_str(self, char *p,             # <<<<<<<<<<<<<<
 *                            const char *str, uint32_t len) except NULL:
 *         cdef char *begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":217
 *         return p
 * 
 *     cdef char *_encode_bin(self, char *p,             # <<<<<<<<<<<<<<
 *                            const char *data, uint32_t len) except NULL:
 *         cdef char *begin
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bin(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, char const *__pyx_v_data, uint32_t __pyx_v_len) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_bin", 0);

  /* "asynctnt/iproto/buffer.pyx":220
 *                            const char *data, uint32_t len) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_bin(len))             # <<<<<<<<<<<<<<
 *         p = mp_encode_bin(p, data, len)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_bin(__pyx_v_len)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 220, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":221
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_bin(len))
 *         p = mp_encode_bin(p, data, len)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_bin(__pyx_v_p, __pyx_v_data, __pyx_v_len);

  /* "asynctnt/iproto/buffer.pyx":222
 *         p = begin = self._ensure_allocated(p, mp_sizeof_bin(len))
 *         p = mp_encode_bin(p, data, len)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":223
 *         p = mp_encode_bin(p, data, len)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_array(self, char *p, uint32_t len) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":217
 *         return p
 * 
 *     cdef char *_encode_bin(self, char *p,             # <<<<<<<<<<<<<<
 *                            const char *data, uint32_t len) except NULL:
 *         cdef char *begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":225
 *         return p
 * 
 *     cdef char *_encode_array(self, char *p, uint32_t len) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_array(len))
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, uint32_t __pyx_v_len) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_array", 0);

  /* "asynctnt/iproto/buffer.pyx":227
 *     cdef char *_encode_array(self, char *p, uint32_t len) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_array(len))             # <<<<<<<<<<<<<<
 *         p = mp_encode_array(p, len)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_array(__pyx_v_len)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 227, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":228
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_array(len))
 *         p = mp_encode_array(p, len)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_array(__pyx_v_p, __pyx_v_len);

  /* "asynctnt/iproto/buffer.pyx":229
 *         p = begin = self._ensure_allocated(p, mp_sizeof_array(len))
 *         p = mp_encode_array(p, len)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":230
 *         p = mp_encode_array(p, len)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_map(self, char *p, uint32_t len) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":225
 *         return p
 * 
 *     cdef char *_encode_array(self, char *p, uint32_t len) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_array(len))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":232
 *         return p
 * 
 *     cdef char *_encode_map(self, char *p, uint32_t len) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_map(len))
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_map(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, uint32_t __pyx_v_len) {
  char *__pyx_v_begin;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_map", 0);

  /* "asynctnt/iproto/buffer.pyx":234
 *     cdef char *_encode_map(self, char *p, uint32_t len) except NULL:
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_map(len))             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, len)
 *         self._length += (p - begin)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, mp_sizeof_map(__pyx_v_len)); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 234, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;
  __pyx_v_begin = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":235
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_map(len))
 *         p = mp_encode_map(p, len)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         return p
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_len);

  /* "asynctnt/iproto/buffer.pyx":236
 *         p = begin = self._ensure_allocated(p, mp_sizeof_map(len))
 *         p = mp_encode_map(p, len)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":237
 *         p = mp_encode_map(p, len)
 *         self._length += (p - begin)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_list(self, char *p, list arr) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":232
 *         return p
 * 
 *     cdef char *_encode_map(self, char *p, uint32_t len) except NULL:             # <<<<<<<<<<<<<<
 *         cdef char *begin
 *         p = begin = self._ensure_allocated(p, mp_sizeof_map(len))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":239
 *         return p
 * 
 *     cdef char *_encode_list(self, char *p, list arr) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t arr_len
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_arr) {
  uint32_t __pyx_v_arr_len;
  PyObject *__pyx_v_item_ptr;
  PyObject *__pyx_v_item = 0;
  uint32_t __pyx_v_i;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  uint32_t __pyx_t_4;
  uint32_t __pyx_t_5;
  uint32_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_list", 0);

  /* "asynctnt/iproto/buffer.pyx":245
 *             object item
 * 
 *         if arr is not None:             # <<<<<<<<<<<<<<
 *             arr_len = <uint32_t>cpython.list.PyList_GET_SIZE(arr)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_arr != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":246
 * 
 *         if arr is not None:
 *             arr_len = <uint32_t>cpython.list.PyList_GET_SIZE(arr)             # <<<<<<<<<<<<<<
 *         else:
 *             arr_len = 0
 */
    __pyx_v_arr_len = ((uint32_t)PyList_GET_SIZE(__pyx_v_arr));

    /* "asynctnt/iproto/buffer.pyx":245
 *             object item
 * 
 *         if arr is not None:             # <<<<<<<<<<<<<<
 *             arr_len = <uint32_t>cpython.list.PyList_GET_SIZE(arr)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/buffer.pyx":248
 *             arr_len = <uint32_t>cpython.list.PyList_GET_SIZE(arr)
 *         else:
 *             arr_len = 0             # <<<<<<<<<<<<<<
 *         p = self._encode_array(p, arr_len)
 * 
 */
  /*else*/ {
    __pyx_v_arr_len = 0;
  }
  __pyx_L3:;

  /* "asynctnt/iproto/buffer.pyx":249
 *         else:
 *             arr_len = 0
 *         p = self._encode_array(p, arr_len)             # <<<<<<<<<<<<<<
 * 
 *         if arr_len > 0:
 */
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array(__pyx_v_self, __pyx_v_p, __pyx_v_arr_len); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 249, __pyx_L1_error)
  __pyx_v_p = __pyx_t_3;

  /* "asynctnt/iproto/buffer.pyx":251
 *         p = self._encode_array(p, arr_len)
 * 
 *         if arr_len > 0:             # <<<<<<<<<<<<<<
 *             for i in range(arr_len):
 *                 item_ptr = cpython.list.PyList_GET_ITEM(arr, i)
 */
  __pyx_t_2 = ((__pyx_v_arr_len > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":252
 * 
 *         if arr_len > 0:
 *             for i in range(arr_len):             # <<<<<<<<<<<<<<
 *                 item_ptr = cpython.list.PyList_GET_ITEM(arr, i)
 *                 item = <object>item_ptr
 */
    __pyx_t_4 = __pyx_v_arr_len;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "asynctnt/iproto/buffer.pyx":253
 *         if arr_len > 0:
 *             for i in range(arr_len):
 *                 item_ptr = cpython.list.PyList_GET_ITEM(arr, i)             # <<<<<<<<<<<<<<
 *                 item = <object>item_ptr
 *                 p = self._encode_obj(p, item)
 */
      __pyx_v_item_ptr = PyList_GET_ITEM(__pyx_v_arr, __pyx_v_i);

      /* "asynctnt/iproto/buffer.pyx":254
 *             for i in range(arr_len):
 *                 item_ptr = cpython.list.PyList_GET_ITEM(arr, i)
 *                 item = <object>item_ptr             # <<<<<<<<<<<<<<
 *                 p = self._encode_obj(p, item)
 *         return p
 */
      __pyx_t_7 = ((PyObject *)__pyx_v_item_ptr);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/buffer.pyx":255
 *                 item_ptr = cpython.list.PyList_GET_ITEM(arr, i)
 *                 item = <object>item_ptr
 *                 p = self._encode_obj(p, item)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_item); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 255, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;
    }

    /* "asynctnt/iproto/buffer.pyx":251
 *         p = self._encode_array(p, arr_len)
 * 
 *         if arr_len > 0:             # <<<<<<<<<<<<<<
 *             for i in range(arr_len):
 *                 item_ptr = cpython.list.PyList_GET_ITEM(arr, i)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":256
 *                 item = <object>item_ptr
 *                 p = self._encode_obj(p, item)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_tuple(self, char *p, tuple t) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":239
 *         return p
 * 
 *     cdef char *_encode_list(self, char *p, list arr) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t arr_len
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":258
 *         return p
 * 
 *     cdef char *_encode_tuple(self, char *p, tuple t) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t t_len
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_tuple(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_t) {
  uint32_t __pyx_v_t_len;
  PyObject *__pyx_v_item_ptr;
  PyObject *__pyx_v_item = 0;
  uint32_t __pyx_v_i;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  uint32_t __pyx_t_4;
  uint32_t __pyx_t_5;
  uint32_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_tuple", 0);

  /* "asynctnt/iproto/buffer.pyx":264
 *             object item
 * 
 *         if t is not None:             # <<<<<<<<<<<<<<
 *             t_len = <uint32_t>cpython.tuple.PyTuple_GET_SIZE(t)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_t != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":265
 * 
 *         if t is not None:
 *             t_len = <uint32_t>cpython.tuple.PyTuple_GET_SIZE(t)             # <<<<<<<<<<<<<<
 *         else:
 *             t_len = 0
 */
    __pyx_v_t_len = ((uint32_t)PyTuple_GET_SIZE(__pyx_v_t));

    /* "asynctnt/iproto/buffer.pyx":264
 *             object item
 * 
 *         if t is not None:             # <<<<<<<<<<<<<<
 *             t_len = <uint32_t>cpython.tuple.PyTuple_GET_SIZE(t)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/buffer.pyx":267
 *             t_len = <uint32_t>cpython.tuple.PyTuple_GET_SIZE(t)
 *         else:
 *             t_len = 0             # <<<<<<<<<<<<<<
 *         p = self._encode_array(p, t_len)
 * 
 */
  /*else*/ {
    __pyx_v_t_len = 0;
  }
  __pyx_L3:;

  /* "asynctnt/iproto/buffer.pyx":268
 *         else:
 *             t_len = 0
 *         p = self._encode_array(p, t_len)             # <<<<<<<<<<<<<<
 * 
 *         if t_len > 0:
 */
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array(__pyx_v_self, __pyx_v_p, __pyx_v_t_len); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 268, __pyx_L1_error)
  __pyx_v_p = __pyx_t_3;

  /* "asynctnt/iproto/buffer.pyx":270
 *         p = self._encode_array(p, t_len)
 * 
 *         if t_len > 0:             # <<<<<<<<<<<<<<
 *             for i in range(t_len):
 *                 item_ptr = cpython.tuple.PyTuple_GET_ITEM(t, i)
 */
  __pyx_t_2 = ((__pyx_v_t_len > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":271
 * 
 *         if t_len > 0:
 *             for i in range(t_len):             # <<<<<<<<<<<<<<
 *                 item_ptr = cpython.tuple.PyTuple_GET_ITEM(t, i)
 *                 item = <object>item_ptr
 */
    __pyx_t_4 = __pyx_v_t_len;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "asynctnt/iproto/buffer.pyx":272
 *         if t_len > 0:
 *             for i in range(t_len):
 *                 item_ptr = cpython.tuple.PyTuple_GET_ITEM(t, i)             # <<<<<<<<<<<<<<
 *                 item = <object>item_ptr
 *                 p = self._encode_obj(p, item)
 */
      __pyx_v_item_ptr = PyTuple_GET_ITEM(__pyx_v_t, __pyx_v_i);

      /* "asynctnt/iproto/buffer.pyx":273
 *             for i in range(t_len):
 *                 item_ptr = cpython.tuple.PyTuple_GET_ITEM(t, i)
 *                 item = <object>item_ptr             # <<<<<<<<<<<<<<
 *                 p = self._encode_obj(p, item)
 *         return p
 */
      __pyx_t_7 = ((PyObject *)__pyx_v_item_ptr);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/buffer.pyx":274
 *                 item_ptr = cpython.tuple.PyTuple_GET_ITEM(t, i)
 *                 item = <object>item_ptr
 *                 p = self._encode_obj(p, item)             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_item); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 274, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;
    }

    /* "asynctnt/iproto/buffer.pyx":270
 *         p = self._encode_array(p, t_len)
 * 
 *         if t_len > 0:             # <<<<<<<<<<<<<<
 *             for i in range(t_len):
 *                 item_ptr = cpython.tuple.PyTuple_GET_ITEM(t, i)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":275
 *                 item = <object>item_ptr
 *                 p = self._encode_obj(p, item)
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_dict(self, char *p, dict d) except NULL:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":258
 *         return p
 * 
 *     cdef char *_encode_tuple(self, char *p, tuple t) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t t_len
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":277
 *         return p
 * 
 *     cdef char *_encode_dict(self, char *p, dict d) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t d_len
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_dict(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_d) {
  uint32_t __pyx_v_d_len;
  PyObject *__pyx_v_pkey;
  PyObject *__pyx_v_pvalue;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  Py_ssize_t __pyx_v_pos;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  char *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_dict", 0);

  /* "asynctnt/iproto/buffer.pyx":285
 *             Py_ssize_t pos
 * 
 *         if d is not None:             # <<<<<<<<<<<<<<
 *             d_len = <uint32_t>cpython.dict.PyDict_Size(d)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_d != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":286
 * 
 *         if d is not None:
 *             d_len = <uint32_t>cpython.dict.PyDict_Size(d)             # <<<<<<<<<<<<<<
 *         else:
 *             d_len = 0
 */
    __pyx_t_3 = PyDict_Size(__pyx_v_d); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(2, 286, __pyx_L1_error)
    __pyx_v_d_len = ((uint32_t)__pyx_t_3);

    /* "asynctnt/iproto/buffer.pyx":285
 *             Py_ssize_t pos
 * 
 *         if d is not None:             # <<<<<<<<<<<<<<
 *             d_len = <uint32_t>cpython.dict.PyDict_Size(d)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/buffer.pyx":288
 *             d_len = <uint32_t>cpython.dict.PyDict_Size(d)
 *         else:
 *             d_len = 0             # <<<<<<<<<<<<<<
 *         p = self._encode_map(p, d_len)
 * 
 */
  /*else*/ {
    __pyx_v_d_len = 0;
  }
  __pyx_L3:;

  /* "asynctnt/iproto/buffer.pyx":289
 *         else:
 *             d_len = 0
 *         p = self._encode_map(p, d_len)             # <<<<<<<<<<<<<<
 * 
 *         pos = 0
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_map(__pyx_v_self, __pyx_v_p, __pyx_v_d_len); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":291
 *         p = self._encode_map(p, d_len)
 * 
 *         pos = 0             # <<<<<<<<<<<<<<
 *         while cpython.dict.PyDict_Next(d, &pos, &pkey, &pvalue):
 *             key = <object>pkey
 */
  __pyx_v_pos = 0;

  /* "asynctnt/iproto/buffer.pyx":292
 * 
 *         pos = 0
 *         while cpython.dict.PyDict_Next(d, &pos, &pkey, &pvalue):             # <<<<<<<<<<<<<<
 *             key = <object>pkey
 *             value = <object>pvalue
 */
  while (1) {
    __pyx_t_2 = (PyDict_Next(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pvalue)) != 0);
    if (!__pyx_t_2) break;

    /* "asynctnt/iproto/buffer.pyx":293
 *         pos = 0
 *         while cpython.dict.PyDict_Next(d, &pos, &pkey, &pvalue):
 *             key = <object>pkey             # <<<<<<<<<<<<<<
 *             value = <object>pvalue
 *             p = self._encode_obj(p, key)
 */
    __pyx_t_5 = ((PyObject *)__pyx_v_pkey);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asynctnt/iproto/buffer.pyx":294
 *         while cpython.dict.PyDict_Next(d, &pos, &pkey, &pvalue):
 *             key = <object>pkey
 *             value = <object>pvalue             # <<<<<<<<<<<<<<
 *             p = self._encode_obj(p, key)
 *             p = self._encode_obj(p, value)
 */
    __pyx_t_5 = ((PyObject *)__pyx_v_pvalue);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asynctnt/iproto/buffer.pyx":295
 *             key = <object>pkey
 *             value = <object>pvalue
 *             p = self._encode_obj(p, key)             # <<<<<<<<<<<<<<
 *             p = self._encode_obj(p, value)
 * 
 */
    __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_key); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 295, __pyx_L1_error)
    __pyx_v_p = __pyx_t_4;

    /* "asynctnt/iproto/buffer.pyx":296
 *             value = <object>pvalue
 *             p = self._encode_obj(p, key)
 *             p = self._encode_obj(p, value)             # <<<<<<<<<<<<<<
 * 
 *         return p
 */
    __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_value); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 296, __pyx_L1_error)
    __pyx_v_p = __pyx_t_4;
  }

  /* "asynctnt/iproto/buffer.pyx":298
 *             p = self._encode_obj(p, value)
 * 
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_key_sequence(self, char *p, t,
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":277
 *         return p
 * 
 *     cdef char *_encode_dict(self, char *p, dict d) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t d_len
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":300
 *         return p
 * 
 *     cdef char *_encode_key_sequence(self, char *p, t,             # <<<<<<<<<<<<<<
 *                                     TntFields fields=None,
 *                                     bint default_none=False) except NULL:
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_t, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence *__pyx_optional_args) {

  /* "asynctnt/iproto/buffer.pyx":301
 * 
 *     cdef char *_encode_key_sequence(self, char *p, t,
 *                                     TntFields fields=None,             # <<<<<<<<<<<<<<
 *                                     bint default_none=False) except NULL:
 *         if isinstance(t, list) or t is None:
 */
  struct C_TntFields *__pyx_v_fields = ((struct C_TntFields *)Py_None);

  /* "asynctnt/iproto/buffer.pyx":302
 *     cdef char *_encode_key_sequence(self, char *p, t,
 *                                     TntFields fields=None,
 *                                     bint default_none=False) except NULL:             # <<<<<<<<<<<<<<
 *         if isinstance(t, list) or t is None:
 *             return self._encode_list(p, <list>t)
 */
  int __pyx_v_default_none = ((int)0);
  PyObject *__pyx_v_msg = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  char *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_key_sequence", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fields = __pyx_optional_args->fields;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_default_none = __pyx_optional_args->default_none;
      }
    }
  }

  /* "asynctnt/iproto/buffer.pyx":303
 *                                     TntFields fields=None,
 *                                     bint default_none=False) except NULL:
 *         if isinstance(t, list) or t is None:             # <<<<<<<<<<<<<<
 *             return self._encode_list(p, <list>t)
 *         elif isinstance(t, tuple):
 */
  __pyx_t_2 = PyList_Check(__pyx_v_t); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_t == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":304
 *                                     bint default_none=False) except NULL:
 *         if isinstance(t, list) or t is None:
 *             return self._encode_list(p, <list>t)             # <<<<<<<<<<<<<<
 *         elif isinstance(t, tuple):
 *             return self._encode_tuple(p, <tuple>t)
 */
    __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list(__pyx_v_self, __pyx_v_p, ((PyObject*)__pyx_v_t)); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 304, __pyx_L1_error)
    __pyx_r = __pyx_t_4;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":303
 *                                     TntFields fields=None,
 *                                     bint default_none=False) except NULL:
 *         if isinstance(t, list) or t is None:             # <<<<<<<<<<<<<<
 *             return self._encode_list(p, <list>t)
 *         elif isinstance(t, tuple):
 */
  }

  /* "asynctnt/iproto/buffer.pyx":305
 *         if isinstance(t, list) or t is None:
 *             return self._encode_list(p, <list>t)
 *         elif isinstance(t, tuple):             # <<<<<<<<<<<<<<
 *             return self._encode_tuple(p, <tuple>t)
 *         elif isinstance(t, dict) and fields is not None:
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_t); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":306
 *             return self._encode_list(p, <list>t)
 *         elif isinstance(t, tuple):
 *             return self._encode_tuple(p, <tuple>t)             # <<<<<<<<<<<<<<
 *         elif isinstance(t, dict) and fields is not None:
 *             return self._encode_list(
 */
    __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_tuple(__pyx_v_self, __pyx_v_p, ((PyObject*)__pyx_v_t)); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 306, __pyx_L1_error)
    __pyx_r = __pyx_t_4;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":305
 *         if isinstance(t, list) or t is None:
 *             return self._encode_list(p, <list>t)
 *         elif isinstance(t, tuple):             # <<<<<<<<<<<<<<
 *             return self._encode_tuple(p, <tuple>t)
 *         elif isinstance(t, dict) and fields is not None:
 */
  }

  /* "asynctnt/iproto/buffer.pyx":307
 *         elif isinstance(t, tuple):
 *             return self._encode_tuple(p, <tuple>t)
 *         elif isinstance(t, dict) and fields is not None:             # <<<<<<<<<<<<<<
 *             return self._encode_list(
 *                 p, dict_to_list_fields(<dict>t, fields, default_none)
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_t); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_fields) != Py_None);
  __pyx_t_1 = (__pyx_t_3 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":309
 *         elif isinstance(t, dict) and fields is not None:
 *             return self._encode_list(
 *                 p, dict_to_list_fields(<dict>t, fields, default_none)             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
    __pyx_t_5 = __pyx_f_8asynctnt_6iproto_8protocol_dict_to_list_fields(((PyObject*)__pyx_v_t), __pyx_v_fields, __pyx_v_default_none); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "asynctnt/iproto/buffer.pyx":308
 *             return self._encode_tuple(p, <tuple>t)
 *         elif isinstance(t, dict) and fields is not None:
 *             return self._encode_list(             # <<<<<<<<<<<<<<
 *                 p, dict_to_list_fields(<dict>t, fields, default_none)
 *             )
 */
    __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list(__pyx_v_self, __pyx_v_p, ((PyObject*)__pyx_t_5)); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 308, __pyx_L1_error)
    __pyx_r = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":307
 *         elif isinstance(t, tuple):
 *             return self._encode_tuple(p, <tuple>t)
 *         elif isinstance(t, dict) and fields is not None:             # <<<<<<<<<<<<<<
 *             return self._encode_list(
 *                 p, dict_to_list_fields(<dict>t, fields, default_none)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":312
 *             )
 *         else:
 *             if fields is not None:             # <<<<<<<<<<<<<<
 *                 msg = 'sequence must be either list, tuple or dict'
 *             else:
 */
  /*else*/ {
    __pyx_t_2 = (((PyObject *)__pyx_v_fields) != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "asynctnt/iproto/buffer.pyx":313
 *         else:
 *             if fields is not None:
 *                 msg = 'sequence must be either list, tuple or dict'             # <<<<<<<<<<<<<<
 *             else:
 *                 msg = 'sequence must be either list or tuple'
 */
      __Pyx_INCREF(__pyx_kp_u_sequence_must_be_either_list_tup);
      __pyx_v_msg = __pyx_kp_u_sequence_must_be_either_list_tup;

      /* "asynctnt/iproto/buffer.pyx":312
 *             )
 *         else:
 *             if fields is not None:             # <<<<<<<<<<<<<<
 *                 msg = 'sequence must be either list, tuple or dict'
 *             else:
 */
      goto __pyx_L8;
    }

    /* "asynctnt/iproto/buffer.pyx":315
 *                 msg = 'sequence must be either list, tuple or dict'
 *             else:
 *                 msg = 'sequence must be either list or tuple'             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 '{}, got: {}'.format(msg, type(t))
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_kp_u_sequence_must_be_either_list_or);
      __pyx_v_msg = __pyx_kp_u_sequence_must_be_either_list_or;
    }
    __pyx_L8:;

    /* "asynctnt/iproto/buffer.pyx":317
 *                 msg = 'sequence must be either list or tuple'
 *             raise TypeError(
 *                 '{}, got: {}'.format(msg, type(t))             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_got, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_msg, ((PyObject *)Py_TYPE(__pyx_v_t))};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 317, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_msg, ((PyObject *)Py_TYPE(__pyx_v_t))};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 317, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_msg);
      __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_t)));
      __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_t)));
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)Py_TYPE(__pyx_v_t)));
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "asynctnt/iproto/buffer.pyx":316
 *             else:
 *                 msg = 'sequence must be either list or tuple'
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 '{}, got: {}'.format(msg, type(t))
 *             )
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(2, 316, __pyx_L1_error)
  }

  /* "asynctnt/iproto/buffer.pyx":300
 *         return p
 * 
 *     cdef char *_encode_key_sequence(self, char *p, t,             # <<<<<<<<<<<<<<
 *                                     TntFields fields=None,
 *                                     bint default_none=False) except NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_key_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":320
 *             )
 * 
 *     cdef char *_encode_obj(self, char *p, object o) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             bytes o_string_temp
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_o) {
  PyObject *__pyx_v_o_string_temp = 0;
  char *__pyx_v_o_string_str;
  Py_ssize_t __pyx_v_o_string_len;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  uint64_t __pyx_t_6;
  int64_t __pyx_t_7;
  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("_encode_obj", 0);

  /* "asynctnt/iproto/buffer.pyx":326
 *             ssize_t o_string_len
 * 
 *         if o is None:             # <<<<<<<<<<<<<<
 *             return self._encode_nil(p)
 * 
 */
  __pyx_t_1 = (__pyx_v_o == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":327
 * 
 *         if o is None:
 *             return self._encode_nil(p)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, bool):
 */
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_nil(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 327, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":326
 *             ssize_t o_string_len
 * 
 *         if o is None:             # <<<<<<<<<<<<<<
 *             return self._encode_nil(p)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":329
 *             return self._encode_nil(p)
 * 
 *         elif isinstance(o, bool):             # <<<<<<<<<<<<<<
 *             return self._encode_bool(p, <bint>o)
 * 
 */
  __pyx_t_4 = ((PyObject*)&PyBool_Type);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_o, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":330
 * 
 *         elif isinstance(o, bool):
 *             return self._encode_bool(p, <bint>o)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, float):
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_o); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 330, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bool(__pyx_v_self, __pyx_v_p, __pyx_t_1); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 330, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":329
 *             return self._encode_nil(p)
 * 
 *         elif isinstance(o, bool):             # <<<<<<<<<<<<<<
 *             return self._encode_bool(p, <bint>o)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":332
 *             return self._encode_bool(p, <bint>o)
 * 
 *         elif isinstance(o, float):             # <<<<<<<<<<<<<<
 *             return self._encode_double(p, <double>o)
 * 
 */
  __pyx_t_1 = PyFloat_Check(__pyx_v_o); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":333
 * 
 *         elif isinstance(o, float):
 *             return self._encode_double(p, <double>o)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, int):
 */
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_o); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 333, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_double(__pyx_v_self, __pyx_v_p, ((double)__pyx_t_5)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 333, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":332
 *             return self._encode_bool(p, <bint>o)
 * 
 *         elif isinstance(o, float):             # <<<<<<<<<<<<<<
 *             return self._encode_double(p, <double>o)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":335
 *             return self._encode_double(p, <double>o)
 * 
 *         elif isinstance(o, int):             # <<<<<<<<<<<<<<
 *             if o >= 0:
 *                 return self._encode_uint(p, <uint64_t>o)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_o); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":336
 * 
 *         elif isinstance(o, int):
 *             if o >= 0:             # <<<<<<<<<<<<<<
 *                 return self._encode_uint(p, <uint64_t>o)
 *             else:
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 336, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "asynctnt/iproto/buffer.pyx":337
 *         elif isinstance(o, int):
 *             if o >= 0:
 *                 return self._encode_uint(p, <uint64_t>o)             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._encode_int(p, <int64_t>o)
 */
      __pyx_t_6 = __Pyx_PyInt_As_uint64_t(__pyx_v_o); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 337, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint(__pyx_v_self, __pyx_v_p, ((uint64_t)__pyx_t_6)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 337, __pyx_L1_error)
      __pyx_r = __pyx_t_3;
      goto __pyx_L0;

      /* "asynctnt/iproto/buffer.pyx":336
 * 
 *         elif isinstance(o, int):
 *             if o >= 0:             # <<<<<<<<<<<<<<
 *                 return self._encode_uint(p, <uint64_t>o)
 *             else:
 */
    }

    /* "asynctnt/iproto/buffer.pyx":339
 *                 return self._encode_uint(p, <uint64_t>o)
 *             else:
 *                 return self._encode_int(p, <int64_t>o)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, bytes):
 */
    /*else*/ {
      __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_o); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 339, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_int(__pyx_v_self, __pyx_v_p, ((int64_t)__pyx_t_7)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 339, __pyx_L1_error)
      __pyx_r = __pyx_t_3;
      goto __pyx_L0;
    }

    /* "asynctnt/iproto/buffer.pyx":335
 *             return self._encode_double(p, <double>o)
 * 
 *         elif isinstance(o, int):             # <<<<<<<<<<<<<<
 *             if o >= 0:
 *                 return self._encode_uint(p, <uint64_t>o)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":341
 *                 return self._encode_int(p, <int64_t>o)
 * 
 *         elif isinstance(o, bytes):             # <<<<<<<<<<<<<<
 *             o_string_str = NULL
 *             o_string_len = 0
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_o); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":342
 * 
 *         elif isinstance(o, bytes):
 *             o_string_str = NULL             # <<<<<<<<<<<<<<
 *             o_string_len = 0
 *             cpython.bytes.PyBytes_AsStringAndSize(o,
 */
    __pyx_v_o_string_str = NULL;

    /* "asynctnt/iproto/buffer.pyx":343
 *         elif isinstance(o, bytes):
 *             o_string_str = NULL
 *             o_string_len = 0             # <<<<<<<<<<<<<<
 *             cpython.bytes.PyBytes_AsStringAndSize(o,
 *                                                   &o_string_str,
 */
    __pyx_v_o_string_len = 0;

    /* "asynctnt/iproto/buffer.pyx":344
 *             o_string_str = NULL
 *             o_string_len = 0
 *             cpython.bytes.PyBytes_AsStringAndSize(o,             # <<<<<<<<<<<<<<
 *                                                   &o_string_str,
 *                                                   &o_string_len)
 */
    __pyx_t_8 = PyBytes_AsStringAndSize(__pyx_v_o, (&__pyx_v_o_string_str), ((Py_ssize_t *)(&__pyx_v_o_string_len))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 344, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":347
 *                                                   &o_string_str,
 *                                                   &o_string_len)
 *             return self._encode_bin(p, o_string_str, <uint32_t>o_string_len)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, str):
 */
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bin(__pyx_v_self, __pyx_v_p, __pyx_v_o_string_str, ((uint32_t)__pyx_v_o_string_len)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 347, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":341
 *                 return self._encode_int(p, <int64_t>o)
 * 
 *         elif isinstance(o, bytes):             # <<<<<<<<<<<<<<
 *             o_string_str = NULL
 *             o_string_len = 0
 */
  }

  /* "asynctnt/iproto/buffer.pyx":349
 *             return self._encode_bin(p, o_string_str, <uint32_t>o_string_len)
 * 
 *         elif isinstance(o, str):             # <<<<<<<<<<<<<<
 *             o_string_temp = encode_unicode_string(o, self._encoding)
 *             o_string_str = NULL
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_o); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":350
 * 
 *         elif isinstance(o, str):
 *             o_string_temp = encode_unicode_string(o, self._encoding)             # <<<<<<<<<<<<<<
 *             o_string_str = NULL
 *             o_string_len = 0
 */
    __pyx_t_4 = __pyx_v_self->_encoding;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_9 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_o, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_o_string_temp = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "asynctnt/iproto/buffer.pyx":351
 *         elif isinstance(o, str):
 *             o_string_temp = encode_unicode_string(o, self._encoding)
 *             o_string_str = NULL             # <<<<<<<<<<<<<<
 *             o_string_len = 0
 *             cpython.bytes.PyBytes_AsStringAndSize(o_string_temp,
 */
    __pyx_v_o_string_str = NULL;

    /* "asynctnt/iproto/buffer.pyx":352
 *             o_string_temp = encode_unicode_string(o, self._encoding)
 *             o_string_str = NULL
 *             o_string_len = 0             # <<<<<<<<<<<<<<
 *             cpython.bytes.PyBytes_AsStringAndSize(o_string_temp,
 *                                                   &o_string_str,
 */
    __pyx_v_o_string_len = 0;

    /* "asynctnt/iproto/buffer.pyx":353
 *             o_string_str = NULL
 *             o_string_len = 0
 *             cpython.bytes.PyBytes_AsStringAndSize(o_string_temp,             # <<<<<<<<<<<<<<
 *                                                   &o_string_str,
 *                                                   &o_string_len)
 */
    __pyx_t_8 = PyBytes_AsStringAndSize(__pyx_v_o_string_temp, (&__pyx_v_o_string_str), ((Py_ssize_t *)(&__pyx_v_o_string_len))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 353, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":357
 *                                                   &o_string_len)
 * 
 *             p = self._encode_str(p, o_string_str, <uint32_t>o_string_len)             # <<<<<<<<<<<<<<
 *             return p
 * 
 */
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_str(__pyx_v_self, __pyx_v_p, __pyx_v_o_string_str, ((uint32_t)__pyx_v_o_string_len)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 357, __pyx_L1_error)
    __pyx_v_p = __pyx_t_3;

    /* "asynctnt/iproto/buffer.pyx":358
 * 
 *             p = self._encode_str(p, o_string_str, <uint32_t>o_string_len)
 *             return p             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, list):
 */
    __pyx_r = __pyx_v_p;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":349
 *             return self._encode_bin(p, o_string_str, <uint32_t>o_string_len)
 * 
 *         elif isinstance(o, str):             # <<<<<<<<<<<<<<
 *             o_string_temp = encode_unicode_string(o, self._encoding)
 *             o_string_str = NULL
 */
  }

  /* "asynctnt/iproto/buffer.pyx":360
 *             return p
 * 
 *         elif isinstance(o, list):             # <<<<<<<<<<<<<<
 *             return self._encode_list(p, <list>o)
 * 
 */
  __pyx_t_1 = PyList_Check(__pyx_v_o); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":361
 * 
 *         elif isinstance(o, list):
 *             return self._encode_list(p, <list>o)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, tuple):
 */
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list(__pyx_v_self, __pyx_v_p, ((PyObject*)__pyx_v_o)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 361, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":360
 *             return p
 * 
 *         elif isinstance(o, list):             # <<<<<<<<<<<<<<
 *             return self._encode_list(p, <list>o)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":363
 *             return self._encode_list(p, <list>o)
 * 
 *         elif isinstance(o, tuple):             # <<<<<<<<<<<<<<
 *             return self._encode_tuple(p, <tuple>o)
 * 
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_o); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/buffer.pyx":364
 * 
 *         elif isinstance(o, tuple):
 *             return self._encode_tuple(p, <tuple>o)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(o, dict):
 */
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_tuple(__pyx_v_self, __pyx_v_p, ((PyObject*)__pyx_v_o)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 364, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":363
 *             return self._encode_list(p, <list>o)
 * 
 *         elif isinstance(o, tuple):             # <<<<<<<<<<<<<<
 *             return self._encode_tuple(p, <tuple>o)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":366
 *             return self._encode_tuple(p, <tuple>o)
 * 
 *         elif isinstance(o, dict):             # <<<<<<<<<<<<<<
 *             return self._encode_dict(p, <dict>o)
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_o); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "asynctnt/iproto/buffer.pyx":367
 * 
 *         elif isinstance(o, dict):
 *             return self._encode_dict(p, <dict>o)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_dict(__pyx_v_self, __pyx_v_p, ((PyObject*)__pyx_v_o)); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 367, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":366
 *             return self._encode_tuple(p, <tuple>o)
 * 
 *         elif isinstance(o, dict):             # <<<<<<<<<<<<<<
 *             return self._encode_dict(p, <dict>o)
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":370
 * 
 *         else:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'Type `{}` is not supported for encoding'.format(type(o)))
 * 
 */
  /*else*/ {

    /* "asynctnt/iproto/buffer.pyx":371
 *         else:
 *             raise TypeError(
 *                 'Type `{}` is not supported for encoding'.format(type(o)))             # <<<<<<<<<<<<<<
 * 
 *     cdef char *_encode_update_ops(self, char *p, list operations,
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_is_not_supported_for_encodi, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, ((PyObject *)Py_TYPE(__pyx_v_o))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_o)));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asynctnt/iproto/buffer.pyx":370
 * 
 *         else:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'Type `{}` is not supported for encoding'.format(type(o)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(2, 370, __pyx_L1_error)
  }

  /* "asynctnt/iproto/buffer.pyx":320
 *             )
 * 
 *     cdef char *_encode_obj(self, char *p, object o) except NULL:             # <<<<<<<<<<<<<<
 *         cdef:
 *             bytes o_string_temp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o_string_temp);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":373
 *                 'Type `{}` is not supported for encoding'.format(type(o)))
 * 
 *     cdef char *_encode_update_ops(self, char *p, list operations,             # <<<<<<<<<<<<<<
 *                                   SchemaSpace space) except NULL:
 *         cdef:
 */

static char *__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_update_ops(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, char *__pyx_v_p, PyObject *__pyx_v_operations, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space) {
  char *__pyx_v_begin;
  uint32_t __pyx_v_ops_len;
  uint32_t __pyx_v_op_len;
  PyObject *__pyx_v_str_temp = 0;
  char *__pyx_v_op_str_c;
  Py_ssize_t __pyx_v_op_str_len;
  char __pyx_v_op;
  uint32_t __pyx_v_extra_length;
  uint64_t __pyx_v_field_no;
  PyObject *__pyx_v_field_no_obj = 0;
  uint32_t __pyx_v_splice_position;
  uint32_t __pyx_v_splice_offset;
  PyObject *__pyx_v_operation = NULL;
  PyObject *__pyx_v_op_type_str = NULL;
  PyObject *__pyx_v_op_argument = NULL;
  PyObject *__pyx_v_splice_position_obj = NULL;
  PyObject *__pyx_v_splice_offset_obj = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  uint64_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  uint32_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_update_ops", 0);

  /* "asynctnt/iproto/buffer.pyx":393
 *             uint32_t splice_position, splice_offset
 * 
 *         begin = NULL             # <<<<<<<<<<<<<<
 * 
 *         if operations is not None:
 */
  __pyx_v_begin = NULL;

  /* "asynctnt/iproto/buffer.pyx":395
 *         begin = NULL
 * 
 *         if operations is not None:             # <<<<<<<<<<<<<<
 *             ops_len = <uint32_t>cpython.list.PyList_GET_SIZE(operations)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_operations != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":396
 * 
 *         if operations is not None:
 *             ops_len = <uint32_t>cpython.list.PyList_GET_SIZE(operations)             # <<<<<<<<<<<<<<
 *         else:
 *             ops_len = 0
 */
    __pyx_v_ops_len = ((uint32_t)PyList_GET_SIZE(__pyx_v_operations));

    /* "asynctnt/iproto/buffer.pyx":395
 *         begin = NULL
 * 
 *         if operations is not None:             # <<<<<<<<<<<<<<
 *             ops_len = <uint32_t>cpython.list.PyList_GET_SIZE(operations)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/buffer.pyx":398
 *             ops_len = <uint32_t>cpython.list.PyList_GET_SIZE(operations)
 *         else:
 *             ops_len = 0             # <<<<<<<<<<<<<<
 * 
 *         p = self._encode_array(p, ops_len)
 */
  /*else*/ {
    __pyx_v_ops_len = 0;
  }
  __pyx_L3:;

  /* "asynctnt/iproto/buffer.pyx":400
 *             ops_len = 0
 * 
 *         p = self._encode_array(p, ops_len)             # <<<<<<<<<<<<<<
 *         if ops_len == 0:
 *             return p
 */
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array(__pyx_v_self, __pyx_v_p, __pyx_v_ops_len); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error)
  __pyx_v_p = __pyx_t_3;

  /* "asynctnt/iproto/buffer.pyx":401
 * 
 *         p = self._encode_array(p, ops_len)
 *         if ops_len == 0:             # <<<<<<<<<<<<<<
 *             return p
 * 
 */
  __pyx_t_2 = ((__pyx_v_ops_len == 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":402
 *         p = self._encode_array(p, ops_len)
 *         if ops_len == 0:
 *             return p             # <<<<<<<<<<<<<<
 * 
 *         for operation in operations:
 */
    __pyx_r = __pyx_v_p;
    goto __pyx_L0;

    /* "asynctnt/iproto/buffer.pyx":401
 * 
 *         p = self._encode_array(p, ops_len)
 *         if ops_len == 0:             # <<<<<<<<<<<<<<
 *             return p
 * 
 */
  }

  /* "asynctnt/iproto/buffer.pyx":404
 *             return p
 * 
 *         for operation in operations:             # <<<<<<<<<<<<<<
 *             if not isinstance(operation, (list, tuple)):
 *                 raise TypeError(
 */
  if (unlikely(__pyx_v_operations == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(2, 404, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_v_operations; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 404, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_operation, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "asynctnt/iproto/buffer.pyx":405
 * 
 *         for operation in operations:
 *             if not isinstance(operation, (list, tuple)):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     'Single operation must be a tuple or list')
 */
    __pyx_t_1 = PyList_Check(__pyx_v_operation); 
    __pyx_t_7 = (__pyx_t_1 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_2 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_7 = PyTuple_Check(__pyx_v_operation); 
    __pyx_t_1 = (__pyx_t_7 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L8_bool_binop_done:;
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/buffer.pyx":406
 *         for operation in operations:
 *             if not isinstance(operation, (list, tuple)):
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Single operation must be a tuple or list')
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 406, __pyx_L1_error)

      /* "asynctnt/iproto/buffer.pyx":405
 * 
 *         for operation in operations:
 *             if not isinstance(operation, (list, tuple)):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     'Single operation must be a tuple or list')
 */
    }

    /* "asynctnt/iproto/buffer.pyx":409
 *                     'Single operation must be a tuple or list')
 * 
 *             op_len = <uint32_t>cpython.list.PyList_GET_SIZE(operation)             # <<<<<<<<<<<<<<
 *             if op_len < 3:
 *                 raise IndexError(
 */
    __pyx_v_op_len = ((uint32_t)PyList_GET_SIZE(__pyx_v_operation));

    /* "asynctnt/iproto/buffer.pyx":410
 * 
 *             op_len = <uint32_t>cpython.list.PyList_GET_SIZE(operation)
 *             if op_len < 3:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     'Operation length must be at least 3')
 */
    __pyx_t_1 = ((__pyx_v_op_len < 3) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/buffer.pyx":411
 *             op_len = <uint32_t>cpython.list.PyList_GET_SIZE(operation)
 *             if op_len < 3:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     'Operation length must be at least 3')
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 411, __pyx_L1_error)

      /* "asynctnt/iproto/buffer.pyx":410
 * 
 *             op_len = <uint32_t>cpython.list.PyList_GET_SIZE(operation)
 *             if op_len < 3:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     'Operation length must be at least 3')
 */
    }

    /* "asynctnt/iproto/buffer.pyx":414
 *                     'Operation length must be at least 3')
 * 
 *             op_type_str = operation[0]             # <<<<<<<<<<<<<<
 *             if isinstance(op_type_str, str):
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_operation, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_op_type_str, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "asynctnt/iproto/buffer.pyx":415
 * 
 *             op_type_str = operation[0]
 *             if isinstance(op_type_str, str):             # <<<<<<<<<<<<<<
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)
 *             elif isinstance(op_type_str, bytes):
 */
    __pyx_t_1 = PyUnicode_Check(__pyx_v_op_type_str); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "asynctnt/iproto/buffer.pyx":416
 *             op_type_str = operation[0]
 *             if isinstance(op_type_str, str):
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)             # <<<<<<<<<<<<<<
 *             elif isinstance(op_type_str, bytes):
 *                 str_temp = <bytes>op_type_str
 */
      __pyx_t_6 = __pyx_v_self->_encoding;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_8 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_op_type_str, ((PyObject*)__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_str_temp, ((PyObject*)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "asynctnt/iproto/buffer.pyx":415
 * 
 *             op_type_str = operation[0]
 *             if isinstance(op_type_str, str):             # <<<<<<<<<<<<<<
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)
 *             elif isinstance(op_type_str, bytes):
 */
      goto __pyx_L11;
    }

    /* "asynctnt/iproto/buffer.pyx":417
 *             if isinstance(op_type_str, str):
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)
 *             elif isinstance(op_type_str, bytes):             # <<<<<<<<<<<<<<
 *                 str_temp = <bytes>op_type_str
 *             else:
 */
    __pyx_t_2 = PyBytes_Check(__pyx_v_op_type_str); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (likely(__pyx_t_1)) {

      /* "asynctnt/iproto/buffer.pyx":418
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)
 *             elif isinstance(op_type_str, bytes):
 *                 str_temp = <bytes>op_type_str             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(
 */
      __pyx_t_8 = __pyx_v_op_type_str;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_str_temp, ((PyObject*)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "asynctnt/iproto/buffer.pyx":417
 *             if isinstance(op_type_str, str):
 *                 str_temp = encode_unicode_string(op_type_str, self._encoding)
 *             elif isinstance(op_type_str, bytes):             # <<<<<<<<<<<<<<
 *                 str_temp = <bytes>op_type_str
 *             else:
 */
      goto __pyx_L11;
    }

    /* "asynctnt/iproto/buffer.pyx":420
 *                 str_temp = <bytes>op_type_str
 *             else:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Operation type must of a str or bytes type')
 * 
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 420, __pyx_L1_error)
    }
    __pyx_L11:;

    /* "asynctnt/iproto/buffer.pyx":423
 *                     'Operation type must of a str or bytes type')
 * 
 *             field_no_obj = operation[1]             # <<<<<<<<<<<<<<
 *             if isinstance(field_no_obj, int):
 *                 field_no = <uint64_t>field_no_obj
 */
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_operation, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_field_no_obj, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "asynctnt/iproto/buffer.pyx":424
 * 
 *             field_no_obj = operation[1]
 *             if isinstance(field_no_obj, int):             # <<<<<<<<<<<<<<
 *                 field_no = <uint64_t>field_no_obj
 *             elif isinstance(field_no_obj, str):
 */
    __pyx_t_1 = PyInt_Check(__pyx_v_field_no_obj); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "asynctnt/iproto/buffer.pyx":425
 *             field_no_obj = operation[1]
 *             if isinstance(field_no_obj, int):
 *                 field_no = <uint64_t>field_no_obj             # <<<<<<<<<<<<<<
 *             elif isinstance(field_no_obj, str):
 *                 if space.fields is not None:
 */
      __pyx_t_9 = __Pyx_PyInt_As_uint64_t(__pyx_v_field_no_obj); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 425, __pyx_L1_error)
      __pyx_v_field_no = ((uint64_t)__pyx_t_9);

      /* "asynctnt/iproto/buffer.pyx":424
 * 
 *             field_no_obj = operation[1]
 *             if isinstance(field_no_obj, int):             # <<<<<<<<<<<<<<
 *                 field_no = <uint64_t>field_no_obj
 *             elif isinstance(field_no_obj, str):
 */
      goto __pyx_L12;
    }

    /* "asynctnt/iproto/buffer.pyx":426
 *             if isinstance(field_no_obj, int):
 *                 field_no = <uint64_t>field_no_obj
 *             elif isinstance(field_no_obj, str):             # <<<<<<<<<<<<<<
 *                 if space.fields is not None:
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)
 */
    __pyx_t_2 = PyUnicode_Check(__pyx_v_field_no_obj); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (likely(__pyx_t_1)) {

      /* "asynctnt/iproto/buffer.pyx":427
 *                 field_no = <uint64_t>field_no_obj
 *             elif isinstance(field_no_obj, str):
 *                 if space.fields is not None:             # <<<<<<<<<<<<<<
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)
 *                 else:
 */
      __pyx_t_1 = (((PyObject *)__pyx_v_space->fields) != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (likely(__pyx_t_2)) {

        /* "asynctnt/iproto/buffer.pyx":428
 *             elif isinstance(field_no_obj, str):
 *                 if space.fields is not None:
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise TypeError(
 */
        if (!(likely(PyUnicode_CheckExact(__pyx_v_field_no_obj))||((__pyx_v_field_no_obj) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_field_no_obj)->tp_name), 0))) __PYX_ERR(2, 428, __pyx_L1_error)
        __pyx_t_9 = __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_id_by_name(__pyx_v_space->fields, ((PyObject*)__pyx_v_field_no_obj)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 428, __pyx_L1_error)
        __pyx_v_field_no = ((uint64_t)__pyx_t_9);

        /* "asynctnt/iproto/buffer.pyx":427
 *                 field_no = <uint64_t>field_no_obj
 *             elif isinstance(field_no_obj, str):
 *                 if space.fields is not None:             # <<<<<<<<<<<<<<
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)
 *                 else:
 */
        goto __pyx_L13;
      }

      /* "asynctnt/iproto/buffer.pyx":430
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)
 *                 else:
 *                     raise TypeError(             # <<<<<<<<<<<<<<
 *                         'Operation field_no must be int as there is '
 *                         'no format declaration in space {}'.format(space.sid))
 */
      /*else*/ {

        /* "asynctnt/iproto/buffer.pyx":432
 *                     raise TypeError(
 *                         'Operation field_no must be int as there is '
 *                         'no format declaration in space {}'.format(space.sid))             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Operation_field_no_must_be_int_a, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_space->sid); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "asynctnt/iproto/buffer.pyx":430
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)
 *                 else:
 *                     raise TypeError(             # <<<<<<<<<<<<<<
 *                         'Operation field_no must be int as there is '
 *                         'no format declaration in space {}'.format(space.sid))
 */
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(2, 430, __pyx_L1_error)
      }
      __pyx_L13:;

      /* "asynctnt/iproto/buffer.pyx":426
 *             if isinstance(field_no_obj, int):
 *                 field_no = <uint64_t>field_no_obj
 *             elif isinstance(field_no_obj, str):             # <<<<<<<<<<<<<<
 *                 if space.fields is not None:
 *                     field_no = <uint64_t>space.fields.id_by_name(field_no_obj)
 */
      goto __pyx_L12;
    }

    /* "asynctnt/iproto/buffer.pyx":434
 *                         'no format declaration in space {}'.format(space.sid))
 *             else:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Operation field_no must be of either int or str type')
 * 
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 434, __pyx_L1_error)
    }
    __pyx_L12:;

    /* "asynctnt/iproto/buffer.pyx":437
 *                     'Operation field_no must be of either int or str type')
 * 
 *             cpython.bytes.PyBytes_AsStringAndSize(str_temp, &op_str_c,             # <<<<<<<<<<<<<<
 *                                                   &op_str_len)
 *             op = <char>0
 */
    __pyx_t_12 = PyBytes_AsStringAndSize(__pyx_v_str_temp, (&__pyx_v_op_str_c), ((Py_ssize_t *)(&__pyx_v_op_str_len))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 437, __pyx_L1_error)

    /* "asynctnt/iproto/buffer.pyx":439
 *             cpython.bytes.PyBytes_AsStringAndSize(str_temp, &op_str_c,
 *                                                   &op_str_len)
 *             op = <char>0             # <<<<<<<<<<<<<<
 *             if op_str_len == 1:
 *                 op = op_str_c[0]
 */
    __pyx_v_op = ((char)0);

    /* "asynctnt/iproto/buffer.pyx":440
 *                                                   &op_str_len)
 *             op = <char>0
 *             if op_str_len == 1:             # <<<<<<<<<<<<<<
 *                 op = op_str_c[0]
 * 
 */
    __pyx_t_2 = ((__pyx_v_op_str_len == 1) != 0);
    if (__pyx_t_2) {

      /* "asynctnt/iproto/buffer.pyx":441
 *             op = <char>0
 *             if op_str_len == 1:
 *                 op = op_str_c[0]             # <<<<<<<<<<<<<<
 * 
 *             if op == tarantool.IPROTO_OP_ADD \
 */
      __pyx_v_op = (__pyx_v_op_str_c[0]);

      /* "asynctnt/iproto/buffer.pyx":440
 *                                                   &op_str_len)
 *             op = <char>0
 *             if op_str_len == 1:             # <<<<<<<<<<<<<<
 *                 op = op_str_c[0]
 * 
 */
    }

    /* "asynctnt/iproto/buffer.pyx":443
 *                 op = op_str_c[0]
 * 
 *             if op == tarantool.IPROTO_OP_ADD \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_SUB \
 *                     or op == tarantool.IPROTO_OP_AND \
 */
    switch (__pyx_v_op) {
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_ADD:
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_SUB:

      /* "asynctnt/iproto/buffer.pyx":444
 * 
 *             if op == tarantool.IPROTO_OP_ADD \
 *                     or op == tarantool.IPROTO_OP_SUB \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_AND \
 *                     or op == tarantool.IPROTO_OP_XOR \
 */
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_AND:

      /* "asynctnt/iproto/buffer.pyx":445
 *             if op == tarantool.IPROTO_OP_ADD \
 *                     or op == tarantool.IPROTO_OP_SUB \
 *                     or op == tarantool.IPROTO_OP_AND \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_XOR \
 *                     or op == tarantool.IPROTO_OP_OR \
 */
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_XOR:

      /* "asynctnt/iproto/buffer.pyx":446
 *                     or op == tarantool.IPROTO_OP_SUB \
 *                     or op == tarantool.IPROTO_OP_AND \
 *                     or op == tarantool.IPROTO_OP_XOR \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_OR \
 *                     or op == tarantool.IPROTO_OP_DELETE:
 */
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_OR:

      /* "asynctnt/iproto/buffer.pyx":447
 *                     or op == tarantool.IPROTO_OP_AND \
 *                     or op == tarantool.IPROTO_OP_XOR \
 *                     or op == tarantool.IPROTO_OP_OR \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_DELETE:
 *                 op_argument = operation[2]
 */
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_DELETE:

      /* "asynctnt/iproto/buffer.pyx":449
 *                     or op == tarantool.IPROTO_OP_OR \
 *                     or op == tarantool.IPROTO_OP_DELETE:
 *                 op_argument = operation[2]             # <<<<<<<<<<<<<<
 *                 if not isinstance(op_argument, int):
 *                     raise TypeError(
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_operation, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_op_argument, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "asynctnt/iproto/buffer.pyx":450
 *                     or op == tarantool.IPROTO_OP_DELETE:
 *                 op_argument = operation[2]
 *                 if not isinstance(op_argument, int):             # <<<<<<<<<<<<<<
 *                     raise TypeError(
 *                         'int argument required for '
 */
      __pyx_t_2 = PyInt_Check(__pyx_v_op_argument); 
      __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/buffer.pyx":451
 *                 op_argument = operation[2]
 *                 if not isinstance(op_argument, int):
 *                     raise TypeError(             # <<<<<<<<<<<<<<
 *                         'int argument required for '
 *                         'Arithmetic and Delete operations'
 */
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 451, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(2, 451, __pyx_L1_error)

        /* "asynctnt/iproto/buffer.pyx":450
 *                     or op == tarantool.IPROTO_OP_DELETE:
 *                 op_argument = operation[2]
 *                 if not isinstance(op_argument, int):             # <<<<<<<<<<<<<<
 *                     raise TypeError(
 *                         'int argument required for '
 */
      }

      /* "asynctnt/iproto/buffer.pyx":458
 *                 # + mp_sizeof_str(1)
 *                 # + mp_sizeof_uint(field_no)
 *                 extra_length = 1 + 2 + mp_sizeof_uint(field_no)             # <<<<<<<<<<<<<<
 *                 p = begin = self._ensure_allocated(p, extra_length)
 * 
 */
      __pyx_v_extra_length = (3 + mp_sizeof_uint(__pyx_v_field_no));

      /* "asynctnt/iproto/buffer.pyx":459
 *                 # + mp_sizeof_uint(field_no)
 *                 extra_length = 1 + 2 + mp_sizeof_uint(field_no)
 *                 p = begin = self._ensure_allocated(p, extra_length)             # <<<<<<<<<<<<<<
 * 
 *                 p = mp_encode_array(p, 3)
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, __pyx_v_extra_length); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 459, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;
      __pyx_v_begin = __pyx_t_3;

      /* "asynctnt/iproto/buffer.pyx":461
 *                 p = begin = self._ensure_allocated(p, extra_length)
 * 
 *                 p = mp_encode_array(p, 3)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)
 */
      __pyx_v_p = mp_encode_array(__pyx_v_p, 3);

      /* "asynctnt/iproto/buffer.pyx":462
 * 
 *                 p = mp_encode_array(p, 3)
 *                 p = mp_encode_str(p, op_str_c, 1)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_uint(p, field_no)
 *                 self._length += (p - begin)
 */
      __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_op_str_c, 1);

      /* "asynctnt/iproto/buffer.pyx":463
 *                 p = mp_encode_array(p, 3)
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)             # <<<<<<<<<<<<<<
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)
 */
      __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_field_no);

      /* "asynctnt/iproto/buffer.pyx":464
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)
 *                 self._length += (p - begin)             # <<<<<<<<<<<<<<
 *                 p = self._encode_obj(p, op_argument)
 *             elif op == tarantool.IPROTO_OP_INSERT \
 */
      __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

      /* "asynctnt/iproto/buffer.pyx":465
 *                 p = mp_encode_uint(p, field_no)
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)             # <<<<<<<<<<<<<<
 *             elif op == tarantool.IPROTO_OP_INSERT \
 *                     or op == tarantool.IPROTO_OP_ASSIGN:
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_op_argument); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 465, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;

      /* "asynctnt/iproto/buffer.pyx":443
 *                 op = op_str_c[0]
 * 
 *             if op == tarantool.IPROTO_OP_ADD \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_SUB \
 *                     or op == tarantool.IPROTO_OP_AND \
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_INSERT:

      /* "asynctnt/iproto/buffer.pyx":466
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)
 *             elif op == tarantool.IPROTO_OP_INSERT \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_ASSIGN:
 *                 op_argument = operation[2]
 */
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_ASSIGN:

      /* "asynctnt/iproto/buffer.pyx":468
 *             elif op == tarantool.IPROTO_OP_INSERT \
 *                     or op == tarantool.IPROTO_OP_ASSIGN:
 *                 op_argument = operation[2]             # <<<<<<<<<<<<<<
 * 
 *                 # mp_sizeof_array(3)
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_operation, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_op_argument, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "asynctnt/iproto/buffer.pyx":473
 *                 # + mp_sizeof_str(1)
 *                 # + mp_sizeof_uint(field_no)
 *                 extra_length = 1 + 2 + mp_sizeof_uint(field_no)             # <<<<<<<<<<<<<<
 *                 p = begin = self._ensure_allocated(p, extra_length)
 * 
 */
      __pyx_v_extra_length = (3 + mp_sizeof_uint(__pyx_v_field_no));

      /* "asynctnt/iproto/buffer.pyx":474
 *                 # + mp_sizeof_uint(field_no)
 *                 extra_length = 1 + 2 + mp_sizeof_uint(field_no)
 *                 p = begin = self._ensure_allocated(p, extra_length)             # <<<<<<<<<<<<<<
 * 
 *                 p = mp_encode_array(p, 3)
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, __pyx_v_extra_length); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 474, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;
      __pyx_v_begin = __pyx_t_3;

      /* "asynctnt/iproto/buffer.pyx":476
 *                 p = begin = self._ensure_allocated(p, extra_length)
 * 
 *                 p = mp_encode_array(p, 3)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)
 */
      __pyx_v_p = mp_encode_array(__pyx_v_p, 3);

      /* "asynctnt/iproto/buffer.pyx":477
 * 
 *                 p = mp_encode_array(p, 3)
 *                 p = mp_encode_str(p, op_str_c, 1)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_uint(p, field_no)
 *                 self._length += (p - begin)
 */
      __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_op_str_c, 1);

      /* "asynctnt/iproto/buffer.pyx":478
 *                 p = mp_encode_array(p, 3)
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)             # <<<<<<<<<<<<<<
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)
 */
      __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_field_no);

      /* "asynctnt/iproto/buffer.pyx":479
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)
 *                 self._length += (p - begin)             # <<<<<<<<<<<<<<
 *                 p = self._encode_obj(p, op_argument)
 * 
 */
      __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

      /* "asynctnt/iproto/buffer.pyx":480
 *                 p = mp_encode_uint(p, field_no)
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)             # <<<<<<<<<<<<<<
 * 
 *             elif op == tarantool.IPROTO_OP_SPLICE:
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_op_argument); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 480, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;

      /* "asynctnt/iproto/buffer.pyx":466
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)
 *             elif op == tarantool.IPROTO_OP_INSERT \             # <<<<<<<<<<<<<<
 *                     or op == tarantool.IPROTO_OP_ASSIGN:
 *                 op_argument = operation[2]
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OP_SPLICE:

      /* "asynctnt/iproto/buffer.pyx":483
 * 
 *             elif op == tarantool.IPROTO_OP_SPLICE:
 *                 if op_len < 5:             # <<<<<<<<<<<<<<
 *                     raise IndexError(
 *                         'Splice operation must have length of 5, '
 */
      __pyx_t_1 = ((__pyx_v_op_len < 5) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/buffer.pyx":486
 *                     raise IndexError(
 *                         'Splice operation must have length of 5, '
 *                         'but got: {}'.format(op_len)             # <<<<<<<<<<<<<<
 *                     )
 * 
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Splice_operation_must_have_lengt, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_op_len); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "asynctnt/iproto/buffer.pyx":484
 *             elif op == tarantool.IPROTO_OP_SPLICE:
 *                 if op_len < 5:
 *                     raise IndexError(             # <<<<<<<<<<<<<<
 *                         'Splice operation must have length of 5, '
 *                         'but got: {}'.format(op_len)
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(2, 484, __pyx_L1_error)

        /* "asynctnt/iproto/buffer.pyx":483
 * 
 *             elif op == tarantool.IPROTO_OP_SPLICE:
 *                 if op_len < 5:             # <<<<<<<<<<<<<<
 *                     raise IndexError(
 *                         'Splice operation must have length of 5, '
 */
      }

      /* "asynctnt/iproto/buffer.pyx":489
 *                     )
 * 
 *                 splice_position_obj = operation[2]             # <<<<<<<<<<<<<<
 *                 splice_offset_obj = operation[3]
 *                 op_argument = operation[4]
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_operation, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_splice_position_obj, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "asynctnt/iproto/buffer.pyx":490
 * 
 *                 splice_position_obj = operation[2]
 *                 splice_offset_obj = operation[3]             # <<<<<<<<<<<<<<
 *                 op_argument = operation[4]
 *                 if not isinstance(splice_position_obj, int):
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_operation, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 490, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_splice_offset_obj, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "asynctnt/iproto/buffer.pyx":491
 *                 splice_position_obj = operation[2]
 *                 splice_offset_obj = operation[3]
 *                 op_argument = operation[4]             # <<<<<<<<<<<<<<
 *                 if not isinstance(splice_position_obj, int):
 *                     raise TypeError('Splice position must be int')
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_operation, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_op_argument, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "asynctnt/iproto/buffer.pyx":492
 *                 splice_offset_obj = operation[3]
 *                 op_argument = operation[4]
 *                 if not isinstance(splice_position_obj, int):             # <<<<<<<<<<<<<<
 *                     raise TypeError('Splice position must be int')
 *                 if not isinstance(splice_offset_obj, int):
 */
      __pyx_t_1 = PyInt_Check(__pyx_v_splice_position_obj); 
      __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
      if (unlikely(__pyx_t_2)) {

        /* "asynctnt/iproto/buffer.pyx":493
 *                 op_argument = operation[4]
 *                 if not isinstance(splice_position_obj, int):
 *                     raise TypeError('Splice position must be int')             # <<<<<<<<<<<<<<
 *                 if not isinstance(splice_offset_obj, int):
 *                     raise TypeError('Splice offset must be int')
 */
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 493, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(2, 493, __pyx_L1_error)

        /* "asynctnt/iproto/buffer.pyx":492
 *                 splice_offset_obj = operation[3]
 *                 op_argument = operation[4]
 *                 if not isinstance(splice_position_obj, int):             # <<<<<<<<<<<<<<
 *                     raise TypeError('Splice position must be int')
 *                 if not isinstance(splice_offset_obj, int):
 */
      }

      /* "asynctnt/iproto/buffer.pyx":494
 *                 if not isinstance(splice_position_obj, int):
 *                     raise TypeError('Splice position must be int')
 *                 if not isinstance(splice_offset_obj, int):             # <<<<<<<<<<<<<<
 *                     raise TypeError('Splice offset must be int')
 * 
 */
      __pyx_t_2 = PyInt_Check(__pyx_v_splice_offset_obj); 
      __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/buffer.pyx":495
 *                     raise TypeError('Splice position must be int')
 *                 if not isinstance(splice_offset_obj, int):
 *                     raise TypeError('Splice offset must be int')             # <<<<<<<<<<<<<<
 * 
 *                 splice_position = <uint32_t>splice_position_obj
 */
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(2, 495, __pyx_L1_error)

        /* "asynctnt/iproto/buffer.pyx":494
 *                 if not isinstance(splice_position_obj, int):
 *                     raise TypeError('Splice position must be int')
 *                 if not isinstance(splice_offset_obj, int):             # <<<<<<<<<<<<<<
 *                     raise TypeError('Splice offset must be int')
 * 
 */
      }

      /* "asynctnt/iproto/buffer.pyx":497
 *                     raise TypeError('Splice offset must be int')
 * 
 *                 splice_position = <uint32_t>splice_position_obj             # <<<<<<<<<<<<<<
 *                 splice_offset = <uint32_t>splice_offset_obj
 * 
 */
      __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_v_splice_position_obj); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 497, __pyx_L1_error)
      __pyx_v_splice_position = ((uint32_t)__pyx_t_13);

      /* "asynctnt/iproto/buffer.pyx":498
 * 
 *                 splice_position = <uint32_t>splice_position_obj
 *                 splice_offset = <uint32_t>splice_offset_obj             # <<<<<<<<<<<<<<
 * 
 *                 # mp_sizeof_array(5) + mp_sizeof_str(1) + ...
 */
      __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_v_splice_offset_obj); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 498, __pyx_L1_error)
      __pyx_v_splice_offset = ((uint32_t)__pyx_t_13);

      /* "asynctnt/iproto/buffer.pyx":504
 *                                 + mp_sizeof_uint(field_no) \
 *                                 + mp_sizeof_uint(splice_position) \
 *                                 + mp_sizeof_uint(splice_offset)             # <<<<<<<<<<<<<<
 *                 p = begin = self._ensure_allocated(p, extra_length)
 * 
 */
      __pyx_v_extra_length = (((3 + mp_sizeof_uint(__pyx_v_field_no)) + mp_sizeof_uint(__pyx_v_splice_position)) + mp_sizeof_uint(__pyx_v_splice_offset));

      /* "asynctnt/iproto/buffer.pyx":505
 *                                 + mp_sizeof_uint(splice_position) \
 *                                 + mp_sizeof_uint(splice_offset)
 *                 p = begin = self._ensure_allocated(p, extra_length)             # <<<<<<<<<<<<<<
 * 
 *                 p = mp_encode_array(p, 5)
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated(__pyx_v_self, __pyx_v_p, __pyx_v_extra_length); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 505, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;
      __pyx_v_begin = __pyx_t_3;

      /* "asynctnt/iproto/buffer.pyx":507
 *                 p = begin = self._ensure_allocated(p, extra_length)
 * 
 *                 p = mp_encode_array(p, 5)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)
 */
      __pyx_v_p = mp_encode_array(__pyx_v_p, 5);

      /* "asynctnt/iproto/buffer.pyx":508
 * 
 *                 p = mp_encode_array(p, 5)
 *                 p = mp_encode_str(p, op_str_c, 1)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_uint(p, field_no)
 *                 p = mp_encode_uint(p, splice_position)
 */
      __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_op_str_c, 1);

      /* "asynctnt/iproto/buffer.pyx":509
 *                 p = mp_encode_array(p, 5)
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_uint(p, splice_position)
 *                 p = mp_encode_uint(p, splice_offset)
 */
      __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_field_no);

      /* "asynctnt/iproto/buffer.pyx":510
 *                 p = mp_encode_str(p, op_str_c, 1)
 *                 p = mp_encode_uint(p, field_no)
 *                 p = mp_encode_uint(p, splice_position)             # <<<<<<<<<<<<<<
 *                 p = mp_encode_uint(p, splice_offset)
 *                 self._length += (p - begin)
 */
      __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_splice_position);

      /* "asynctnt/iproto/buffer.pyx":511
 *                 p = mp_encode_uint(p, field_no)
 *                 p = mp_encode_uint(p, splice_position)
 *                 p = mp_encode_uint(p, splice_offset)             # <<<<<<<<<<<<<<
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)
 */
      __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_splice_offset);

      /* "asynctnt/iproto/buffer.pyx":512
 *                 p = mp_encode_uint(p, splice_position)
 *                 p = mp_encode_uint(p, splice_offset)
 *                 self._length += (p - begin)             # <<<<<<<<<<<<<<
 *                 p = self._encode_obj(p, op_argument)
 *             else:
 */
      __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

      /* "asynctnt/iproto/buffer.pyx":513
 *                 p = mp_encode_uint(p, splice_offset)
 *                 self._length += (p - begin)
 *                 p = self._encode_obj(p, op_argument)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(
 */
      __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj(__pyx_v_self, __pyx_v_p, __pyx_v_op_argument); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 513, __pyx_L1_error)
      __pyx_v_p = __pyx_t_3;

      /* "asynctnt/iproto/buffer.pyx":482
 *                 p = self._encode_obj(p, op_argument)
 * 
 *             elif op == tarantool.IPROTO_OP_SPLICE:             # <<<<<<<<<<<<<<
 *                 if op_len < 5:
 *                     raise IndexError(
 */
      break;
      default:

      /* "asynctnt/iproto/buffer.pyx":516
 *             else:
 *                 raise TypeError(
 *                     'Unknown update operation type `{}`'.format(op_type_str))             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unknown_update_operation_type, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_v_op_type_str) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_op_type_str);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "asynctnt/iproto/buffer.pyx":515
 *                 p = self._encode_obj(p, op_argument)
 *             else:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Unknown update operation type `{}`'.format(op_type_str))
 *         return p
 */
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 515, __pyx_L1_error)
      break;
    }

    /* "asynctnt/iproto/buffer.pyx":404
 *             return p
 * 
 *         for operation in operations:             # <<<<<<<<<<<<<<
 *             if not isinstance(operation, (list, tuple)):
 *                 raise TypeError(
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asynctnt/iproto/buffer.pyx":517
 *                 raise TypeError(
 *                     'Unknown update operation type `{}`'.format(op_type_str))
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_call(self, str func_name, args) except *:
 */
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asynctnt/iproto/buffer.pyx":373
 *                 'Type `{}` is not supported for encoding'.format(type(o)))
 * 
 *     cdef char *_encode_update_ops(self, char *p, list operations,             # <<<<<<<<<<<<<<
 *                                   SchemaSpace space) except NULL:
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer._encode_update_ops", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_str_temp);
  __Pyx_XDECREF(__pyx_v_field_no_obj);
  __Pyx_XDECREF(__pyx_v_operation);
  __Pyx_XDECREF(__pyx_v_op_type_str);
  __Pyx_XDECREF(__pyx_v_op_argument);
  __Pyx_XDECREF(__pyx_v_splice_position_obj);
  __Pyx_XDECREF(__pyx_v_splice_offset_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/buffer.pyx":519
 *         return p
 * 
 *     cdef void encode_request_call(self, str func_name, args) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_call(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  PyObject *__pyx_v_func_name_temp = 0;
  char *__pyx_v_func_name_str;
  Py_ssize_t __pyx_v_func_name_len;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_call", 0);

  /* "asynctnt/iproto/buffer.pyx":530
 *             ssize_t func_name_len
 * 
 *         func_name_str = NULL             # <<<<<<<<<<<<<<
 *         func_name_len = 0
 * 
 */
  __pyx_v_func_name_str = NULL;

  /* "asynctnt/iproto/buffer.pyx":531
 * 
 *         func_name_str = NULL
 *         func_name_len = 0             # <<<<<<<<<<<<<<
 * 
 *         func_name_temp = encode_unicode_string(func_name, self._encoding)
 */
  __pyx_v_func_name_len = 0;

  /* "asynctnt/iproto/buffer.pyx":533
 *         func_name_len = 0
 * 
 *         func_name_temp = encode_unicode_string(func_name, self._encoding)             # <<<<<<<<<<<<<<
 *         cpython.bytes.PyBytes_AsStringAndSize(func_name_temp,
 *                                               &func_name_str,
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_func_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_func_name_temp = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/buffer.pyx":534
 * 
 *         func_name_temp = encode_unicode_string(func_name, self._encoding)
 *         cpython.bytes.PyBytes_AsStringAndSize(func_name_temp,             # <<<<<<<<<<<<<<
 *                                               &func_name_str,
 *                                               &func_name_len)
 */
  __pyx_t_3 = PyBytes_AsStringAndSize(__pyx_v_func_name_temp, (&__pyx_v_func_name_str), ((Py_ssize_t *)(&__pyx_v_func_name_len))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 534, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":537
 *                                               &func_name_str,
 *                                               &func_name_len)
 *         body_map_sz = 2             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map()
 */
  __pyx_v_body_map_sz = 2;

  /* "asynctnt/iproto/buffer.pyx":546
 *                        + 1 \
 *                        + mp_sizeof_str(<uint32_t>func_name_len) \
 *                        + 1             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = ((2 + mp_sizeof_str(((uint32_t)__pyx_v_func_name_len))) + 1);

  /* "asynctnt/iproto/buffer.pyx":548
 *                        + 1
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 548, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":550
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_FUNCTION_NAME)
 */
  __pyx_t_4 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_4;
  __pyx_v_begin = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":551
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_FUNCTION_NAME)
 *         p = mp_encode_str(p, func_name_str, <uint32_t>func_name_len)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":552
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_FUNCTION_NAME)             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, func_name_str, <uint32_t>func_name_len)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_FUNCTION_NAME);

  /* "asynctnt/iproto/buffer.pyx":553
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_FUNCTION_NAME)
 *         p = mp_encode_str(p, func_name_str, <uint32_t>func_name_len)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_func_name_str, ((uint32_t)__pyx_v_func_name_len));

  /* "asynctnt/iproto/buffer.pyx":555
 *         p = mp_encode_str(p, func_name_str, <uint32_t>func_name_len)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, args)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE);

  /* "asynctnt/iproto/buffer.pyx":556
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         p = self._encode_key_sequence(p, args)
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":557
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, args)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_eval(self, str expression, args) except *:
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_args, NULL); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 557, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":519
 *         return p
 * 
 *     cdef void encode_request_call(self, str func_name, args) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_func_name_temp);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":559
 *         p = self._encode_key_sequence(p, args)
 * 
 *     cdef void encode_request_eval(self, str expression, args) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_expression, PyObject *__pyx_v_args) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  PyObject *__pyx_v_expression_temp = 0;
  char *__pyx_v_expression_str;
  Py_ssize_t __pyx_v_expression_len;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_eval", 0);

  /* "asynctnt/iproto/buffer.pyx":570
 *             ssize_t expression_len
 * 
 *         expression_str = NULL             # <<<<<<<<<<<<<<
 *         expression_len = 0
 * 
 */
  __pyx_v_expression_str = NULL;

  /* "asynctnt/iproto/buffer.pyx":571
 * 
 *         expression_str = NULL
 *         expression_len = 0             # <<<<<<<<<<<<<<
 * 
 *         expression_temp = encode_unicode_string(expression, self._encoding)
 */
  __pyx_v_expression_len = 0;

  /* "asynctnt/iproto/buffer.pyx":573
 *         expression_len = 0
 * 
 *         expression_temp = encode_unicode_string(expression, self._encoding)             # <<<<<<<<<<<<<<
 *         cpython.bytes.PyBytes_AsStringAndSize(expression_temp,
 *                                               &expression_str,
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_expression, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_expression_temp = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/buffer.pyx":574
 * 
 *         expression_temp = encode_unicode_string(expression, self._encoding)
 *         cpython.bytes.PyBytes_AsStringAndSize(expression_temp,             # <<<<<<<<<<<<<<
 *                                               &expression_str,
 *                                               &expression_len)
 */
  __pyx_t_3 = PyBytes_AsStringAndSize(__pyx_v_expression_temp, (&__pyx_v_expression_str), ((Py_ssize_t *)(&__pyx_v_expression_len))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 574, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":577
 *                                               &expression_str,
 *                                               &expression_len)
 *         body_map_sz = 2             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map()
 */
  __pyx_v_body_map_sz = 2;

  /* "asynctnt/iproto/buffer.pyx":586
 *                        + 1 \
 *                        + mp_sizeof_str(<uint32_t>expression_len) \
 *                        + 1             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = ((2 + mp_sizeof_str(((uint32_t)__pyx_v_expression_len))) + 1);

  /* "asynctnt/iproto/buffer.pyx":588
 *                        + 1
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 588, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":590
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_EXPR)
 */
  __pyx_t_4 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_4;
  __pyx_v_begin = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":591
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_EXPR)
 *         p = mp_encode_str(p, expression_str, <uint32_t>expression_len)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":592
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_EXPR)             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, expression_str, <uint32_t>expression_len)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_EXPR);

  /* "asynctnt/iproto/buffer.pyx":593
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_EXPR)
 *         p = mp_encode_str(p, expression_str, <uint32_t>expression_len)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_expression_str, ((uint32_t)__pyx_v_expression_len));

  /* "asynctnt/iproto/buffer.pyx":595
 *         p = mp_encode_str(p, expression_str, <uint32_t>expression_len)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, args)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE);

  /* "asynctnt/iproto/buffer.pyx":596
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         p = self._encode_key_sequence(p, args)
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":597
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, args)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_select(self, SchemaSpace space, SchemaIndex index,
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_args, NULL); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 597, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":559
 *         p = self._encode_key_sequence(p, args)
 * 
 *     cdef void encode_request_eval(self, str expression, args) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expression_temp);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":599
 *         p = self._encode_key_sequence(p, args)
 * 
 *     cdef void encode_request_select(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key, uint64_t offset, uint64_t limit,
 *                                     uint32_t iterator) except *:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_select(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, uint64_t __pyx_v_offset, uint64_t __pyx_v_limit, uint32_t __pyx_v_iterator) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  uint32_t __pyx_v_space_id;
  uint32_t __pyx_v_index_id;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_select", 0);

  /* "asynctnt/iproto/buffer.pyx":609
 *             uint32_t space_id, index_id
 * 
 *         space_id = space.sid             # <<<<<<<<<<<<<<
 *         index_id = index.iid
 * 
 */
  __pyx_t_1 = __pyx_v_space->sid;
  __pyx_v_space_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":610
 * 
 *         space_id = space.sid
 *         index_id = index.iid             # <<<<<<<<<<<<<<
 * 
 *         body_map_sz = 3 \
 */
  __pyx_t_1 = __pyx_v_index->iid;
  __pyx_v_index_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":615
 *                       + <uint32_t>(index_id > 0) \
 *                       + <uint32_t>(offset > 0) \
 *                       + <uint32_t>(iterator > 0)             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map(body_map_sz)
 */
  __pyx_v_body_map_sz = (((3 + ((uint32_t)(__pyx_v_index_id > 0))) + ((uint32_t)(__pyx_v_offset > 0))) + ((uint32_t)(__pyx_v_iterator > 0)));

  /* "asynctnt/iproto/buffer.pyx":626
 *                        + 9 \
 *                        + 1 \
 *                        + 9             # <<<<<<<<<<<<<<
 * 
 *         if index_id > 0:
 */
  __pyx_v_max_body_len = 21;

  /* "asynctnt/iproto/buffer.pyx":628
 *                        + 9
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index_id)
 *             max_body_len += 1 + 9
 */
  __pyx_t_2 = ((__pyx_v_index_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":630
 *         if index_id > 0:
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index_id)
 *             max_body_len += 1 + 9             # <<<<<<<<<<<<<<
 *         if offset > 0:
 *             # mp_sizeof_uint(TP_OFFSET) + mp_sizeof_uint(offset)
 */
    __pyx_v_max_body_len = (__pyx_v_max_body_len + 10);

    /* "asynctnt/iproto/buffer.pyx":628
 *                        + 9
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index_id)
 *             max_body_len += 1 + 9
 */
  }

  /* "asynctnt/iproto/buffer.pyx":631
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index_id)
 *             max_body_len += 1 + 9
 *         if offset > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_OFFSET) + mp_sizeof_uint(offset)
 *             max_body_len += 1 + 9
 */
  __pyx_t_2 = ((__pyx_v_offset > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":633
 *         if offset > 0:
 *             # mp_sizeof_uint(TP_OFFSET) + mp_sizeof_uint(offset)
 *             max_body_len += 1 + 9             # <<<<<<<<<<<<<<
 *         if iterator > 0:
 *             # mp_sizeof_uint(TP_ITERATOR) + mp_sizeof_uint(iterator)
 */
    __pyx_v_max_body_len = (__pyx_v_max_body_len + 10);

    /* "asynctnt/iproto/buffer.pyx":631
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index_id)
 *             max_body_len += 1 + 9
 *         if offset > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_OFFSET) + mp_sizeof_uint(offset)
 *             max_body_len += 1 + 9
 */
  }

  /* "asynctnt/iproto/buffer.pyx":634
 *             # mp_sizeof_uint(TP_OFFSET) + mp_sizeof_uint(offset)
 *             max_body_len += 1 + 9
 *         if iterator > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_ITERATOR) + mp_sizeof_uint(iterator)
 *             max_body_len += 1 + 1
 */
  __pyx_t_2 = ((__pyx_v_iterator > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":636
 *         if iterator > 0:
 *             # mp_sizeof_uint(TP_ITERATOR) + mp_sizeof_uint(iterator)
 *             max_body_len += 1 + 1             # <<<<<<<<<<<<<<
 * 
 *         max_body_len += 1  # mp_sizeof_uint(TP_KEY);
 */
    __pyx_v_max_body_len = (__pyx_v_max_body_len + 2);

    /* "asynctnt/iproto/buffer.pyx":634
 *             # mp_sizeof_uint(TP_OFFSET) + mp_sizeof_uint(offset)
 *             max_body_len += 1 + 9
 *         if iterator > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_ITERATOR) + mp_sizeof_uint(iterator)
 *             max_body_len += 1 + 1
 */
  }

  /* "asynctnt/iproto/buffer.pyx":638
 *             max_body_len += 1 + 1
 * 
 *         max_body_len += 1  # mp_sizeof_uint(TP_KEY);             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = (__pyx_v_max_body_len + 1);

  /* "asynctnt/iproto/buffer.pyx":640
 *         max_body_len += 1  # mp_sizeof_uint(TP_KEY);
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 640, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":642
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 */
  __pyx_t_3 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_3;
  __pyx_v_begin = __pyx_t_3;

  /* "asynctnt/iproto/buffer.pyx":643
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":644
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, space_id)
 *         p = mp_encode_uint(p, tarantool.IPROTO_LIMIT)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SPACE_ID);

  /* "asynctnt/iproto/buffer.pyx":645
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_LIMIT)
 *         p = mp_encode_uint(p, limit)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_space_id);

  /* "asynctnt/iproto/buffer.pyx":646
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)
 *         p = mp_encode_uint(p, tarantool.IPROTO_LIMIT)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, limit)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_LIMIT);

  /* "asynctnt/iproto/buffer.pyx":647
 *         p = mp_encode_uint(p, space_id)
 *         p = mp_encode_uint(p, tarantool.IPROTO_LIMIT)
 *         p = mp_encode_uint(p, limit)             # <<<<<<<<<<<<<<
 * 
 *         if index_id > 0:
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_limit);

  /* "asynctnt/iproto/buffer.pyx":649
 *         p = mp_encode_uint(p, limit)
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 */
  __pyx_t_2 = ((__pyx_v_index_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":650
 * 
 *         if index_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, index_id)
 *         if offset > 0:
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INDEX_ID);

    /* "asynctnt/iproto/buffer.pyx":651
 *         if index_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)             # <<<<<<<<<<<<<<
 *         if offset > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_index_id);

    /* "asynctnt/iproto/buffer.pyx":649
 *         p = mp_encode_uint(p, limit)
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":652
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 *         if offset > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)
 *             p = mp_encode_uint(p, offset)
 */
  __pyx_t_2 = ((__pyx_v_offset > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":653
 *             p = mp_encode_uint(p, index_id)
 *         if offset > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, offset)
 *         if iterator > 0:
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OFFSET);

    /* "asynctnt/iproto/buffer.pyx":654
 *         if offset > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)
 *             p = mp_encode_uint(p, offset)             # <<<<<<<<<<<<<<
 *         if iterator > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_ITERATOR)
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_offset);

    /* "asynctnt/iproto/buffer.pyx":652
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 *         if offset > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)
 *             p = mp_encode_uint(p, offset)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":655
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)
 *             p = mp_encode_uint(p, offset)
 *         if iterator > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_ITERATOR)
 *             p = mp_encode_uint(p, iterator)
 */
  __pyx_t_2 = ((__pyx_v_iterator > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":656
 *             p = mp_encode_uint(p, offset)
 *         if iterator > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_ITERATOR)             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, iterator)
 * 
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_ITERATOR);

    /* "asynctnt/iproto/buffer.pyx":657
 *         if iterator > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_ITERATOR)
 *             p = mp_encode_uint(p, iterator)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_iterator);

    /* "asynctnt/iproto/buffer.pyx":655
 *             p = mp_encode_uint(p, tarantool.IPROTO_OFFSET)
 *             p = mp_encode_uint(p, offset)
 *         if iterator > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_ITERATOR)
 *             p = mp_encode_uint(p, iterator)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":659
 *             p = mp_encode_uint(p, iterator)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_KEY);

  /* "asynctnt/iproto/buffer.pyx":660
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":661
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, key, index.fields, False)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_insert(self, SchemaSpace space, t) except *:
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_index->fields);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.fields = ((struct C_TntFields *)__pyx_t_4);
  __pyx_t_5.default_none = 0;
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_key, &__pyx_t_5); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 661, __pyx_L1_error)
  __pyx_v_p = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asynctnt/iproto/buffer.pyx":599
 *         p = self._encode_key_sequence(p, args)
 * 
 *     cdef void encode_request_select(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key, uint64_t offset, uint64_t limit,
 *                                     uint32_t iterator) except *:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":663
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 * 
 *     cdef void encode_request_insert(self, SchemaSpace space, t) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  uint32_t __pyx_v_space_id;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_insert", 0);

  /* "asynctnt/iproto/buffer.pyx":671
 *             uint32_t space_id
 * 
 *         space_id = space.sid             # <<<<<<<<<<<<<<
 * 
 *         body_map_sz = 2
 */
  __pyx_t_1 = __pyx_v_space->sid;
  __pyx_v_space_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":673
 *         space_id = space.sid
 * 
 *         body_map_sz = 2             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map(body_map_sz)
 */
  __pyx_v_body_map_sz = 2;

  /* "asynctnt/iproto/buffer.pyx":682
 *                        + 1 \
 *                        + 9 \
 *                        + 1             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = 12;

  /* "asynctnt/iproto/buffer.pyx":684
 *                        + 1
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 684, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":686
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 */
  __pyx_t_2 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_2;
  __pyx_v_begin = __pyx_t_2;

  /* "asynctnt/iproto/buffer.pyx":687
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":688
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, space_id)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SPACE_ID);

  /* "asynctnt/iproto/buffer.pyx":689
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_space_id);

  /* "asynctnt/iproto/buffer.pyx":691
 *         p = mp_encode_uint(p, space_id)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, t, space.fields, True)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE);

  /* "asynctnt/iproto/buffer.pyx":692
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         p = self._encode_key_sequence(p, t, space.fields, True)
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":693
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, t, space.fields, True)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_delete(self, SchemaSpace space, SchemaIndex index,
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_space->fields);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4.__pyx_n = 2;
  __pyx_t_4.fields = ((struct C_TntFields *)__pyx_t_3);
  __pyx_t_4.default_none = 1;
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_t, &__pyx_t_4); if (unlikely(__pyx_t_2 == ((char *)NULL))) __PYX_ERR(2, 693, __pyx_L1_error)
  __pyx_v_p = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asynctnt/iproto/buffer.pyx":663
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 * 
 *     cdef void encode_request_insert(self, SchemaSpace space, t) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":695
 *         p = self._encode_key_sequence(p, t, space.fields, True)
 * 
 *     cdef void encode_request_delete(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key) except *:
 *         cdef:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key) {
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  uint32_t __pyx_v_space_id;
  uint32_t __pyx_v_index_id;
  char *__pyx_v_begin;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_delete", 0);

  /* "asynctnt/iproto/buffer.pyx":703
 *             uint32_t space_id, index_id
 * 
 *         space_id = space.sid             # <<<<<<<<<<<<<<
 *         index_id = index.iid
 * 
 */
  __pyx_t_1 = __pyx_v_space->sid;
  __pyx_v_space_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":704
 * 
 *         space_id = space.sid
 *         index_id = index.iid             # <<<<<<<<<<<<<<
 * 
 *         body_map_sz = 2 \
 */
  __pyx_t_1 = __pyx_v_index->iid;
  __pyx_v_index_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":707
 * 
 *         body_map_sz = 2 \
 *                       + <uint32_t>(index_id > 0)             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map(body_map_sz)
 */
  __pyx_v_body_map_sz = (2 + ((uint32_t)(__pyx_v_index_id > 0)));

  /* "asynctnt/iproto/buffer.pyx":714
 *         max_body_len = 1 \
 *                        + 1 \
 *                        + 9             # <<<<<<<<<<<<<<
 * 
 *         if index_id > 0:
 */
  __pyx_v_max_body_len = 11;

  /* "asynctnt/iproto/buffer.pyx":716
 *                        + 9
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index)
 *             max_body_len += 1 + 9
 */
  __pyx_t_2 = ((__pyx_v_index_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":718
 *         if index_id > 0:
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index)
 *             max_body_len += 1 + 9             # <<<<<<<<<<<<<<
 * 
 *         max_body_len += 1  # mp_sizeof_uint(TP_KEY);
 */
    __pyx_v_max_body_len = (__pyx_v_max_body_len + 10);

    /* "asynctnt/iproto/buffer.pyx":716
 *                        + 9
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             # mp_sizeof_uint(TP_INDEX) + mp_sizeof_uint(index)
 *             max_body_len += 1 + 9
 */
  }

  /* "asynctnt/iproto/buffer.pyx":720
 *             max_body_len += 1 + 9
 * 
 *         max_body_len += 1  # mp_sizeof_uint(TP_KEY);             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = (__pyx_v_max_body_len + 1);

  /* "asynctnt/iproto/buffer.pyx":722
 *         max_body_len += 1  # mp_sizeof_uint(TP_KEY);
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 722, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":724
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 */
  __pyx_t_3 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_3;
  __pyx_v_begin = __pyx_t_3;

  /* "asynctnt/iproto/buffer.pyx":725
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":726
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, space_id)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SPACE_ID);

  /* "asynctnt/iproto/buffer.pyx":727
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)             # <<<<<<<<<<<<<<
 * 
 *         if index_id > 0:
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_space_id);

  /* "asynctnt/iproto/buffer.pyx":729
 *         p = mp_encode_uint(p, space_id)
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 */
  __pyx_t_2 = ((__pyx_v_index_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":730
 * 
 *         if index_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, index_id)
 * 
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INDEX_ID);

    /* "asynctnt/iproto/buffer.pyx":731
 *         if index_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_index_id);

    /* "asynctnt/iproto/buffer.pyx":729
 *         p = mp_encode_uint(p, space_id)
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":733
 *             p = mp_encode_uint(p, index_id)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_KEY);

  /* "asynctnt/iproto/buffer.pyx":734
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 * 
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":735
 *         p = mp_encode_uint(p, tarantool.IPROTO_KEY)
 *         self._length += (p - begin)
 *         p = self._encode_key_sequence(p, key, index.fields, False)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_update(self, SchemaSpace space, SchemaIndex index,
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_index->fields);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.fields = ((struct C_TntFields *)__pyx_t_4);
  __pyx_t_5.default_none = 0;
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_key, &__pyx_t_5); if (unlikely(__pyx_t_3 == ((char *)NULL))) __PYX_ERR(2, 735, __pyx_L1_error)
  __pyx_v_p = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asynctnt/iproto/buffer.pyx":695
 *         p = self._encode_key_sequence(p, t, space.fields, True)
 * 
 *     cdef void encode_request_delete(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key) except *:
 *         cdef:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":737
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 * 
 *     cdef void encode_request_update(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key_tuple, list operations,
 *                                     bint is_upsert=False) except *:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key_tuple, PyObject *__pyx_v_operations, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update *__pyx_optional_args) {

  /* "asynctnt/iproto/buffer.pyx":739
 *     cdef void encode_request_update(self, SchemaSpace space, SchemaIndex index,
 *                                     key_tuple, list operations,
 *                                     bint is_upsert=False) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */
  int __pyx_v_is_upsert = ((int)0);
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  uint32_t __pyx_v_space_id;
  uint32_t __pyx_v_index_id;
  uint32_t __pyx_v_key_of_tuple;
  uint32_t __pyx_v_key_of_operations;
  struct C_TntFields *__pyx_v_fields = 0;
  int __pyx_v_default_fields_none;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_update", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_is_upsert = __pyx_optional_args->is_upsert;
    }
  }

  /* "asynctnt/iproto/buffer.pyx":750
 *             bint default_fields_none
 * 
 *         space_id = space.sid             # <<<<<<<<<<<<<<
 *         index_id = index.iid
 * 
 */
  __pyx_t_1 = __pyx_v_space->sid;
  __pyx_v_space_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":751
 * 
 *         space_id = space.sid
 *         index_id = index.iid             # <<<<<<<<<<<<<<
 * 
 *         if not is_upsert:
 */
  __pyx_t_1 = __pyx_v_index->iid;
  __pyx_v_index_id = __pyx_t_1;

  /* "asynctnt/iproto/buffer.pyx":753
 *         index_id = index.iid
 * 
 *         if not is_upsert:             # <<<<<<<<<<<<<<
 *             key_of_tuple = tarantool.IPROTO_KEY
 *             key_of_operations = tarantool.IPROTO_TUPLE
 */
  __pyx_t_2 = ((!(__pyx_v_is_upsert != 0)) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":754
 * 
 *         if not is_upsert:
 *             key_of_tuple = tarantool.IPROTO_KEY             # <<<<<<<<<<<<<<
 *             key_of_operations = tarantool.IPROTO_TUPLE
 *             fields = index.fields
 */
    __pyx_v_key_of_tuple = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_KEY;

    /* "asynctnt/iproto/buffer.pyx":755
 *         if not is_upsert:
 *             key_of_tuple = tarantool.IPROTO_KEY
 *             key_of_operations = tarantool.IPROTO_TUPLE             # <<<<<<<<<<<<<<
 *             fields = index.fields
 *             default_fields_none = False
 */
    __pyx_v_key_of_operations = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE;

    /* "asynctnt/iproto/buffer.pyx":756
 *             key_of_tuple = tarantool.IPROTO_KEY
 *             key_of_operations = tarantool.IPROTO_TUPLE
 *             fields = index.fields             # <<<<<<<<<<<<<<
 *             default_fields_none = False
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_index->fields);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_fields = ((struct C_TntFields *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "asynctnt/iproto/buffer.pyx":757
 *             key_of_operations = tarantool.IPROTO_TUPLE
 *             fields = index.fields
 *             default_fields_none = False             # <<<<<<<<<<<<<<
 *         else:
 *             key_of_tuple = tarantool.IPROTO_TUPLE
 */
    __pyx_v_default_fields_none = 0;

    /* "asynctnt/iproto/buffer.pyx":753
 *         index_id = index.iid
 * 
 *         if not is_upsert:             # <<<<<<<<<<<<<<
 *             key_of_tuple = tarantool.IPROTO_KEY
 *             key_of_operations = tarantool.IPROTO_TUPLE
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/buffer.pyx":759
 *             default_fields_none = False
 *         else:
 *             key_of_tuple = tarantool.IPROTO_TUPLE             # <<<<<<<<<<<<<<
 *             key_of_operations = tarantool.IPROTO_OPS
 *             fields = space.fields
 */
  /*else*/ {
    __pyx_v_key_of_tuple = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE;

    /* "asynctnt/iproto/buffer.pyx":760
 *         else:
 *             key_of_tuple = tarantool.IPROTO_TUPLE
 *             key_of_operations = tarantool.IPROTO_OPS             # <<<<<<<<<<<<<<
 *             fields = space.fields
 *             default_fields_none = True
 */
    __pyx_v_key_of_operations = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_OPS;

    /* "asynctnt/iproto/buffer.pyx":761
 *             key_of_tuple = tarantool.IPROTO_TUPLE
 *             key_of_operations = tarantool.IPROTO_OPS
 *             fields = space.fields             # <<<<<<<<<<<<<<
 *             default_fields_none = True
 * 
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_space->fields);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_fields = ((struct C_TntFields *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "asynctnt/iproto/buffer.pyx":762
 *             key_of_operations = tarantool.IPROTO_OPS
 *             fields = space.fields
 *             default_fields_none = True             # <<<<<<<<<<<<<<
 * 
 *         body_map_sz = 3 + <uint32_t>(index_id > 0)
 */
    __pyx_v_default_fields_none = 1;
  }
  __pyx_L3:;

  /* "asynctnt/iproto/buffer.pyx":764
 *             default_fields_none = True
 * 
 *         body_map_sz = 3 + <uint32_t>(index_id > 0)             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map(body_map_sz)
 */
  __pyx_v_body_map_sz = (3 + ((uint32_t)(__pyx_v_index_id > 0)));

  /* "asynctnt/iproto/buffer.pyx":771
 *         max_body_len = 1 \
 *                        + 1 \
 *                        + 9             # <<<<<<<<<<<<<<
 * 
 *         if index_id > 0:
 */
  __pyx_v_max_body_len = 11;

  /* "asynctnt/iproto/buffer.pyx":773
 *                        + 9
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             # + mp_sizeof_uint(TP_INDEX)
 *             # + mp_sizeof_uint(index)
 */
  __pyx_t_2 = ((__pyx_v_index_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":776
 *             # + mp_sizeof_uint(TP_INDEX)
 *             # + mp_sizeof_uint(index)
 *             max_body_len += 1 + 9             # <<<<<<<<<<<<<<
 * 
 *         max_body_len += 1  # + mp_sizeof_uint(TP_KEY)
 */
    __pyx_v_max_body_len = (__pyx_v_max_body_len + 10);

    /* "asynctnt/iproto/buffer.pyx":773
 *                        + 9
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             # + mp_sizeof_uint(TP_INDEX)
 *             # + mp_sizeof_uint(index)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":778
 *             max_body_len += 1 + 9
 * 
 *         max_body_len += 1  # + mp_sizeof_uint(TP_KEY)             # <<<<<<<<<<<<<<
 *         max_body_len += 1  # + mp_sizeof_uint(TP_TUPLE)
 * 
 */
  __pyx_v_max_body_len = (__pyx_v_max_body_len + 1);

  /* "asynctnt/iproto/buffer.pyx":779
 * 
 *         max_body_len += 1  # + mp_sizeof_uint(TP_KEY)
 *         max_body_len += 1  # + mp_sizeof_uint(TP_TUPLE)             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = (__pyx_v_max_body_len + 1);

  /* "asynctnt/iproto/buffer.pyx":781
 *         max_body_len += 1  # + mp_sizeof_uint(TP_TUPLE)
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 781, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":783
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 */
  __pyx_t_4 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_4;
  __pyx_v_begin = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":784
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":785
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, space_id)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SPACE_ID);

  /* "asynctnt/iproto/buffer.pyx":786
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SPACE_ID)
 *         p = mp_encode_uint(p, space_id)             # <<<<<<<<<<<<<<
 * 
 *         if index_id > 0:
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_space_id);

  /* "asynctnt/iproto/buffer.pyx":788
 *         p = mp_encode_uint(p, space_id)
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 */
  __pyx_t_2 = ((__pyx_v_index_id > 0) != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/buffer.pyx":789
 * 
 *         if index_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, index_id)
 *         self._length += (p - begin)
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INDEX_ID);

    /* "asynctnt/iproto/buffer.pyx":790
 *         if index_id > 0:
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 * 
 */
    __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_v_index_id);

    /* "asynctnt/iproto/buffer.pyx":788
 *         p = mp_encode_uint(p, space_id)
 * 
 *         if index_id > 0:             # <<<<<<<<<<<<<<
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 */
  }

  /* "asynctnt/iproto/buffer.pyx":791
 *             p = mp_encode_uint(p, tarantool.IPROTO_INDEX_ID)
 *             p = mp_encode_uint(p, index_id)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 * 
 *         p = self._encode_uint(p, key_of_tuple)
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":793
 *         self._length += (p - begin)
 * 
 *         p = self._encode_uint(p, key_of_tuple)             # <<<<<<<<<<<<<<
 *         p = self._encode_key_sequence(p, key_tuple, fields,
 *                                       default_fields_none)
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint(__pyx_v_self, __pyx_v_p, __pyx_v_key_of_tuple); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 793, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":794
 * 
 *         p = self._encode_uint(p, key_of_tuple)
 *         p = self._encode_key_sequence(p, key_tuple, fields,             # <<<<<<<<<<<<<<
 *                                       default_fields_none)
 * 
 */
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.fields = __pyx_v_fields;
  __pyx_t_5.default_none = __pyx_v_default_fields_none;
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_key_tuple, &__pyx_t_5); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 794, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":797
 *                                       default_fields_none)
 * 
 *         p = self._encode_uint(p, key_of_operations)             # <<<<<<<<<<<<<<
 *         p = self._encode_update_ops(p, operations, space)
 * 
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint(__pyx_v_self, __pyx_v_p, __pyx_v_key_of_operations); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 797, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":798
 * 
 *         p = self._encode_uint(p, key_of_operations)
 *         p = self._encode_update_ops(p, operations, space)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_upsert(self, SchemaSpace space, t,
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_update_ops(__pyx_v_self, __pyx_v_p, __pyx_v_operations, __pyx_v_space); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 798, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":737
 *         p = self._encode_key_sequence(p, key, index.fields, False)
 * 
 *     cdef void encode_request_update(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                                     key_tuple, list operations,
 *                                     bint is_upsert=False) except *:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_fields);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":800
 *         p = self._encode_update_ops(p, operations, space)
 * 
 *     cdef void encode_request_upsert(self, SchemaSpace space, t,             # <<<<<<<<<<<<<<
 *                                     list operations) except *:
 *         self.encode_request_update(space, space.get_index(0),
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_operations) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_upsert", 0);

  /* "asynctnt/iproto/buffer.pyx":802
 *     cdef void encode_request_upsert(self, SchemaSpace space, t,
 *                                     list operations) except *:
 *         self.encode_request_update(space, space.get_index(0),             # <<<<<<<<<<<<<<
 *                                    t, operations, True)
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_space->__pyx_vtab)->get_index(__pyx_v_space, __pyx_int_0, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "asynctnt/iproto/buffer.pyx":803
 *                                     list operations) except *:
 *         self.encode_request_update(space, space.get_index(0),
 *                                    t, operations, True)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_sql(self, str query, args) except *:
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.is_upsert = 1;
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update(__pyx_v_self, __pyx_v_space, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_1), __pyx_v_t, __pyx_v_operations, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/buffer.pyx":800
 *         p = self._encode_update_ops(p, operations, space)
 * 
 *     cdef void encode_request_upsert(self, SchemaSpace space, t,             # <<<<<<<<<<<<<<
 *                                     list operations) except *:
 *         self.encode_request_update(space, space.get_index(0),
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_upsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":805
 *                                    t, operations, True)
 * 
 *     cdef void encode_request_sql(self, str query, args) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  PyObject *__pyx_v_query_temp = 0;
  char *__pyx_v_query_str;
  Py_ssize_t __pyx_v_query_len;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_sql", 0);

  /* "asynctnt/iproto/buffer.pyx":816
 *             ssize_t query_len
 * 
 *         query_str = NULL             # <<<<<<<<<<<<<<
 *         query_len = 0
 * 
 */
  __pyx_v_query_str = NULL;

  /* "asynctnt/iproto/buffer.pyx":817
 * 
 *         query_str = NULL
 *         query_len = 0             # <<<<<<<<<<<<<<
 * 
 *         query_temp = encode_unicode_string(query, self._encoding)
 */
  __pyx_v_query_len = 0;

  /* "asynctnt/iproto/buffer.pyx":819
 *         query_len = 0
 * 
 *         query_temp = encode_unicode_string(query, self._encoding)             # <<<<<<<<<<<<<<
 *         cpython.bytes.PyBytes_AsStringAndSize(query_temp,
 *                                               &query_str,
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_query, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_query_temp = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/buffer.pyx":820
 * 
 *         query_temp = encode_unicode_string(query, self._encoding)
 *         cpython.bytes.PyBytes_AsStringAndSize(query_temp,             # <<<<<<<<<<<<<<
 *                                               &query_str,
 *                                               &query_len)
 */
  __pyx_t_3 = PyBytes_AsStringAndSize(__pyx_v_query_temp, (&__pyx_v_query_str), ((Py_ssize_t *)(&__pyx_v_query_len))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 820, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":823
 *                                               &query_str,
 *                                               &query_len)
 *         body_map_sz = 2             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map()
 */
  __pyx_v_body_map_sz = 2;

  /* "asynctnt/iproto/buffer.pyx":832
 *                        + 1 \
 *                        + mp_sizeof_str(<uint32_t>query_len) \
 *                        + 1             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = ((2 + mp_sizeof_str(((uint32_t)__pyx_v_query_len))) + 1);

  /* "asynctnt/iproto/buffer.pyx":834
 *                        + 1
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 834, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":836
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_TEXT)
 */
  __pyx_t_4 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_4;
  __pyx_v_begin = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":837
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_TEXT)
 *         p = mp_encode_str(p, query_str, <uint32_t>query_len)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":838
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_TEXT)             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, query_str, <uint32_t>query_len)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SQL_TEXT);

  /* "asynctnt/iproto/buffer.pyx":839
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_TEXT)
 *         p = mp_encode_str(p, query_str, <uint32_t>query_len)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_BIND)
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_query_str, ((uint32_t)__pyx_v_query_len));

  /* "asynctnt/iproto/buffer.pyx":841
 *         p = mp_encode_str(p, query_str, <uint32_t>query_len)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_BIND)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 *         # TODO: replace with custom encoder
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SQL_BIND);

  /* "asynctnt/iproto/buffer.pyx":842
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_SQL_BIND)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 *         # TODO: replace with custom encoder
 *         # TODO: need to simultaneously encode ordinal and named params
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":845
 *         # TODO: replace with custom encoder
 *         # TODO: need to simultaneously encode ordinal and named params
 *         p = self._encode_key_sequence(p, args)             # <<<<<<<<<<<<<<
 * 
 *     cdef void encode_request_auth(self,
 */
  __pyx_t_4 = __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence(__pyx_v_self, __pyx_v_p, __pyx_v_args, NULL); if (unlikely(__pyx_t_4 == ((char *)NULL))) __PYX_ERR(2, 845, __pyx_L1_error)
  __pyx_v_p = __pyx_t_4;

  /* "asynctnt/iproto/buffer.pyx":805
 *                                    t, operations, True)
 * 
 *     cdef void encode_request_sql(self, str query, args) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *begin
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_query_temp);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/buffer.pyx":847
 *         p = self._encode_key_sequence(p, args)
 * 
 *     cdef void encode_request_auth(self,             # <<<<<<<<<<<<<<
 *                                   bytes username,
 *                                   bytes scramble) except *:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_scramble) {
  char *__pyx_v_begin;
  char *__pyx_v_p;
  uint32_t __pyx_v_body_map_sz;
  uint32_t __pyx_v_max_body_len;
  char *__pyx_v_username_str;
  Py_ssize_t __pyx_v_username_len;
  char *__pyx_v_scramble_str;
  Py_ssize_t __pyx_v_scramble_len;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_request_auth", 0);

  /* "asynctnt/iproto/buffer.pyx":862
 *             ssize_t scramble_len
 * 
 *         cpython.bytes.PyBytes_AsStringAndSize(username,             # <<<<<<<<<<<<<<
 *                                               &username_str, &username_len)
 *         cpython.bytes.PyBytes_AsStringAndSize(scramble,
 */
  __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_username, (&__pyx_v_username_str), ((Py_ssize_t *)(&__pyx_v_username_len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 862, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":864
 *         cpython.bytes.PyBytes_AsStringAndSize(username,
 *                                               &username_str, &username_len)
 *         cpython.bytes.PyBytes_AsStringAndSize(scramble,             # <<<<<<<<<<<<<<
 *                                               &scramble_str, &scramble_len)
 *         body_map_sz = 2
 */
  __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_scramble, (&__pyx_v_scramble_str), ((Py_ssize_t *)(&__pyx_v_scramble_len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 864, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":866
 *         cpython.bytes.PyBytes_AsStringAndSize(scramble,
 *                                               &scramble_str, &scramble_len)
 *         body_map_sz = 2             # <<<<<<<<<<<<<<
 *         # Size description:
 *         # mp_sizeof_map()
 */
  __pyx_v_body_map_sz = 2;

  /* "asynctnt/iproto/buffer.pyx":881
 *                        + 1 \
 *                        + 1 + 9 \
 *                        + mp_sizeof_str(<uint32_t>scramble_len)             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_allocated(max_body_len)
 */
  __pyx_v_max_body_len = ((((((2 + mp_sizeof_str(((uint32_t)__pyx_v_username_len))) + 1) + 1) + 1) + 9) + mp_sizeof_str(((uint32_t)__pyx_v_scramble_len)));

  /* "asynctnt/iproto/buffer.pyx":883
 *                        + mp_sizeof_str(<uint32_t>scramble_len)
 * 
 *         self.ensure_allocated(max_body_len)             # <<<<<<<<<<<<<<
 * 
 *         p = begin = &self._buf[self._length]
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated(__pyx_v_self, __pyx_v_max_body_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 883, __pyx_L1_error)

  /* "asynctnt/iproto/buffer.pyx":885
 *         self.ensure_allocated(max_body_len)
 * 
 *         p = begin = &self._buf[self._length]             # <<<<<<<<<<<<<<
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_USER_NAME)
 */
  __pyx_t_2 = (&(__pyx_v_self->_buf[__pyx_v_self->_length]));
  __pyx_v_p = __pyx_t_2;
  __pyx_v_begin = __pyx_t_2;

  /* "asynctnt/iproto/buffer.pyx":886
 * 
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)             # <<<<<<<<<<<<<<
 *         p = mp_encode_uint(p, tarantool.IPROTO_USER_NAME)
 *         p = mp_encode_str(p, username_str, <uint32_t>username_len)
 */
  __pyx_v_p = mp_encode_map(__pyx_v_p, __pyx_v_body_map_sz);

  /* "asynctnt/iproto/buffer.pyx":887
 *         p = begin = &self._buf[self._length]
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_USER_NAME)             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, username_str, <uint32_t>username_len)
 * 
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_USER_NAME);

  /* "asynctnt/iproto/buffer.pyx":888
 *         p = mp_encode_map(p, body_map_sz)
 *         p = mp_encode_uint(p, tarantool.IPROTO_USER_NAME)
 *         p = mp_encode_str(p, username_str, <uint32_t>username_len)             # <<<<<<<<<<<<<<
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_username_str, ((uint32_t)__pyx_v_username_len));

  /* "asynctnt/iproto/buffer.pyx":890
 *         p = mp_encode_str(p, username_str, <uint32_t>username_len)
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)             # <<<<<<<<<<<<<<
 *         p = mp_encode_array(p, 2)
 *         p = mp_encode_str(p, "chap-sha1", 9)
 */
  __pyx_v_p = mp_encode_uint(__pyx_v_p, __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_TUPLE);

  /* "asynctnt/iproto/buffer.pyx":891
 * 
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         p = mp_encode_array(p, 2)             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, "chap-sha1", 9)
 *         p = mp_encode_str(p, scramble_str, <uint32_t>scramble_len)
 */
  __pyx_v_p = mp_encode_array(__pyx_v_p, 2);

  /* "asynctnt/iproto/buffer.pyx":892
 *         p = mp_encode_uint(p, tarantool.IPROTO_TUPLE)
 *         p = mp_encode_array(p, 2)
 *         p = mp_encode_str(p, "chap-sha1", 9)             # <<<<<<<<<<<<<<
 *         p = mp_encode_str(p, scramble_str, <uint32_t>scramble_len)
 *         self._length += (p - begin)
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, ((char const *)"chap-sha1"), 9);

  /* "asynctnt/iproto/buffer.pyx":893
 *         p = mp_encode_array(p, 2)
 *         p = mp_encode_str(p, "chap-sha1", 9)
 *         p = mp_encode_str(p, scramble_str, <uint32_t>scramble_len)             # <<<<<<<<<<<<<<
 *         self._length += (p - begin)
 */
  __pyx_v_p = mp_encode_str(__pyx_v_p, __pyx_v_scramble_str, ((uint32_t)__pyx_v_scramble_len));

  /* "asynctnt/iproto/buffer.pyx":894
 *         p = mp_encode_str(p, "chap-sha1", 9)
 *         p = mp_encode_str(p, scramble_str, <uint32_t>scramble_len)
 *         self._length += (p - begin)             # <<<<<<<<<<<<<<
 */
  __pyx_v_self->_length = (__pyx_v_self->_length + (__pyx_v_p - __pyx_v_begin));

  /* "asynctnt/iproto/buffer.pyx":847
 *         p = self._encode_key_sequence(p, args)
 * 
 *     cdef void encode_request_auth(self,             # <<<<<<<<<<<<<<
 *                                   bytes username,
 *                                   bytes scramble) except *:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.encode_request_auth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_10__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_12__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_11WriteBuffer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.WriteBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/rbuffer.pyx":11
 * @cython.final
 * cdef class ReadBuffer:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.initial_buffer_size = 0
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_v_self));

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asynctnt/iproto/rbuffer.pyx":12
 * cdef class ReadBuffer:
 *     def __cinit__(self):
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 *         self.initial_buffer_size = 0
 *         self.len = 0
 */
  __pyx_v_self->buf = NULL;

  /* "asynctnt/iproto/rbuffer.pyx":13
 *     def __cinit__(self):
 *         self.buf = NULL
 *         self.initial_buffer_size = 0             # <<<<<<<<<<<<<<
 *         self.len = 0
 *         self.use = 0
 */
  __pyx_v_self->initial_buffer_size = 0;

  /* "asynctnt/iproto/rbuffer.pyx":14
 *         self.buf = NULL
 *         self.initial_buffer_size = 0
 *         self.len = 0             # <<<<<<<<<<<<<<
 *         self.use = 0
 *         self.encoding = None
 */
  __pyx_v_self->len = 0;

  /* "asynctnt/iproto/rbuffer.pyx":15
 *         self.initial_buffer_size = 0
 *         self.len = 0
 *         self.use = 0             # <<<<<<<<<<<<<<
 *         self.encoding = None
 * 
 */
  __pyx_v_self->use = 0;

  /* "asynctnt/iproto/rbuffer.pyx":16
 *         self.len = 0
 *         self.use = 0
 *         self.encoding = None             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->encoding);
  __Pyx_DECREF(__pyx_v_self->encoding);
  __pyx_v_self->encoding = ((PyObject*)Py_None);

  /* "asynctnt/iproto/rbuffer.pyx":11
 * @cython.final
 * cdef class ReadBuffer:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.initial_buffer_size = 0
 */

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

/* "asynctnt/iproto/rbuffer.pyx":19
 * 
 *     @staticmethod
 *     cdef ReadBuffer new(str encoding, size_t initial_buffer_size=0x80000):             # <<<<<<<<<<<<<<
 *         cdef ReadBuffer b
 *         b = ReadBuffer.__new__(ReadBuffer)
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_new(PyObject *__pyx_v_encoding, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new *__pyx_optional_args) {
  size_t __pyx_v_initial_buffer_size = ((size_t)0x80000);
  struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_b = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_buffer_size = __pyx_optional_args->initial_buffer_size;
    }
  }

  /* "asynctnt/iproto/rbuffer.pyx":21
 *     cdef ReadBuffer new(str encoding, size_t initial_buffer_size=0x80000):
 *         cdef ReadBuffer b
 *         b = ReadBuffer.__new__(ReadBuffer)             # <<<<<<<<<<<<<<
 * 
 *         b.buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>initial_buffer_size)
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_ReadBuffer(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_ReadBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 21, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_b = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/rbuffer.pyx":23
 *         b = ReadBuffer.__new__(ReadBuffer)
 * 
 *         b.buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>initial_buffer_size)             # <<<<<<<<<<<<<<
 *         if b.buf is NULL:
 *             raise MemoryError
 */
  __pyx_v_b->buf = ((char *)PyMem_Malloc(((sizeof(char)) * ((size_t)__pyx_v_initial_buffer_size))));

  /* "asynctnt/iproto/rbuffer.pyx":24
 * 
 *         b.buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>initial_buffer_size)
 *         if b.buf is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError
 * 
 */
  __pyx_t_2 = ((__pyx_v_b->buf == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "asynctnt/iproto/rbuffer.pyx":25
 *         b.buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>initial_buffer_size)
 *         if b.buf is NULL:
 *             raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         b.initial_buffer_size = initial_buffer_size
 */
    PyErr_NoMemory(); __PYX_ERR(7, 25, __pyx_L1_error)

    /* "asynctnt/iproto/rbuffer.pyx":24
 * 
 *         b.buf = <char*>PyMem_Malloc(sizeof(char) * <size_t>initial_buffer_size)
 *         if b.buf is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError
 * 
 */
  }

  /* "asynctnt/iproto/rbuffer.pyx":27
 *             raise MemoryError
 * 
 *         b.initial_buffer_size = initial_buffer_size             # <<<<<<<<<<<<<<
 *         b.len = initial_buffer_size
 *         b.use = 0
 */
  __pyx_v_b->initial_buffer_size = __pyx_v_initial_buffer_size;

  /* "asynctnt/iproto/rbuffer.pyx":28
 * 
 *         b.initial_buffer_size = initial_buffer_size
 *         b.len = initial_buffer_size             # <<<<<<<<<<<<<<
 *         b.use = 0
 *         b.encoding = encoding
 */
  __pyx_v_b->len = __pyx_v_initial_buffer_size;

  /* "asynctnt/iproto/rbuffer.pyx":29
 *         b.initial_buffer_size = initial_buffer_size
 *         b.len = initial_buffer_size
 *         b.use = 0             # <<<<<<<<<<<<<<
 *         b.encoding = encoding
 *         return b
 */
  __pyx_v_b->use = 0;

  /* "asynctnt/iproto/rbuffer.pyx":30
 *         b.len = initial_buffer_size
 *         b.use = 0
 *         b.encoding = encoding             # <<<<<<<<<<<<<<
 *         return b
 * 
 */
  __Pyx_INCREF(__pyx_v_encoding);
  __Pyx_GIVEREF(__pyx_v_encoding);
  __Pyx_GOTREF(__pyx_v_b->encoding);
  __Pyx_DECREF(__pyx_v_b->encoding);
  __pyx_v_b->encoding = __pyx_v_encoding;

  /* "asynctnt/iproto/rbuffer.pyx":31
 *         b.use = 0
 *         b.encoding = encoding
 *         return b             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_b));
  __pyx_r = __pyx_v_b;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pyx":19
 * 
 *     @staticmethod
 *     cdef ReadBuffer new(str encoding, size_t initial_buffer_size=0x80000):             # <<<<<<<<<<<<<<
 *         cdef ReadBuffer b
 *         b = ReadBuffer.__new__(ReadBuffer)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_b);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/rbuffer.pyx":33
 *         return b
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.buf is not NULL:
 *             PyMem_Free(self.buf)
 */

/* Python wrapper */
static void __pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_2__dealloc__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_v_self));

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

static void __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_2__dealloc__(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "asynctnt/iproto/rbuffer.pyx":34
 * 
 *     def __dealloc__(self):
 *         if self.buf is not NULL:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self.buf)
 *             self.buf = NULL
 */
  __pyx_t_1 = ((__pyx_v_self->buf != NULL) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/rbuffer.pyx":35
 *     def __dealloc__(self):
 *         if self.buf is not NULL:
 *             PyMem_Free(self.buf)             # <<<<<<<<<<<<<<
 *             self.buf = NULL
 *         self.initial_buffer_size = 0
 */
    PyMem_Free(__pyx_v_self->buf);

    /* "asynctnt/iproto/rbuffer.pyx":36
 *         if self.buf is not NULL:
 *             PyMem_Free(self.buf)
 *             self.buf = NULL             # <<<<<<<<<<<<<<
 *         self.initial_buffer_size = 0
 *         self.len = 0
 */
    __pyx_v_self->buf = NULL;

    /* "asynctnt/iproto/rbuffer.pyx":34
 * 
 *     def __dealloc__(self):
 *         if self.buf is not NULL:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self.buf)
 *             self.buf = NULL
 */
  }

  /* "asynctnt/iproto/rbuffer.pyx":37
 *             PyMem_Free(self.buf)
 *             self.buf = NULL
 *         self.initial_buffer_size = 0             # <<<<<<<<<<<<<<
 *         self.len = 0
 *         self.use = 0
 */
  __pyx_v_self->initial_buffer_size = 0;

  /* "asynctnt/iproto/rbuffer.pyx":38
 *             self.buf = NULL
 *         self.initial_buffer_size = 0
 *         self.len = 0             # <<<<<<<<<<<<<<
 *         self.use = 0
 * 
 */
  __pyx_v_self->len = 0;

  /* "asynctnt/iproto/rbuffer.pyx":39
 *         self.initial_buffer_size = 0
 *         self.len = 0
 *         self.use = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef void _reallocate(self, size_t new_size) except *:
 */
  __pyx_v_self->use = 0;

  /* "asynctnt/iproto/rbuffer.pyx":33
 *         return b
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.buf is not NULL:
 *             PyMem_Free(self.buf)
 */

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

/* "asynctnt/iproto/rbuffer.pyx":41
 *         self.use = 0
 * 
 *     cdef void _reallocate(self, size_t new_size) except *:             # <<<<<<<<<<<<<<
 *         cdef char *new_buf
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_new_size) {
  char *__pyx_v_new_buf;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reallocate", 0);

  /* "asynctnt/iproto/rbuffer.pyx":45
 * 
 *         # print('ReadBuffer reallocate: {}'.format(new_size))
 *         new_buf = <char*>PyMem_Realloc(<void*>self.buf, <size_t>new_size)             # <<<<<<<<<<<<<<
 *         if new_buf is NULL:
 *             PyMem_Free(self.buf)
 */
  __pyx_v_new_buf = ((char *)PyMem_Realloc(((void *)__pyx_v_self->buf), ((size_t)__pyx_v_new_size)));

  /* "asynctnt/iproto/rbuffer.pyx":46
 *         # print('ReadBuffer reallocate: {}'.format(new_size))
 *         new_buf = <char*>PyMem_Realloc(<void*>self.buf, <size_t>new_size)
 *         if new_buf is NULL:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self.buf)
 *             self.buf = NULL
 */
  __pyx_t_1 = ((__pyx_v_new_buf == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/rbuffer.pyx":47
 *         new_buf = <char*>PyMem_Realloc(<void*>self.buf, <size_t>new_size)
 *         if new_buf is NULL:
 *             PyMem_Free(self.buf)             # <<<<<<<<<<<<<<
 *             self.buf = NULL
 *             self.initial_buffer_size = 0
 */
    PyMem_Free(__pyx_v_self->buf);

    /* "asynctnt/iproto/rbuffer.pyx":48
 *         if new_buf is NULL:
 *             PyMem_Free(self.buf)
 *             self.buf = NULL             # <<<<<<<<<<<<<<
 *             self.initial_buffer_size = 0
 *             self.len = 0
 */
    __pyx_v_self->buf = NULL;

    /* "asynctnt/iproto/rbuffer.pyx":49
 *             PyMem_Free(self.buf)
 *             self.buf = NULL
 *             self.initial_buffer_size = 0             # <<<<<<<<<<<<<<
 *             self.len = 0
 *             self.use = 0
 */
    __pyx_v_self->initial_buffer_size = 0;

    /* "asynctnt/iproto/rbuffer.pyx":50
 *             self.buf = NULL
 *             self.initial_buffer_size = 0
 *             self.len = 0             # <<<<<<<<<<<<<<
 *             self.use = 0
 *             raise MemoryError
 */
    __pyx_v_self->len = 0;

    /* "asynctnt/iproto/rbuffer.pyx":51
 *             self.initial_buffer_size = 0
 *             self.len = 0
 *             self.use = 0             # <<<<<<<<<<<<<<
 *             raise MemoryError
 *         self.buf = new_buf
 */
    __pyx_v_self->use = 0;

    /* "asynctnt/iproto/rbuffer.pyx":52
 *             self.len = 0
 *             self.use = 0
 *             raise MemoryError             # <<<<<<<<<<<<<<
 *         self.buf = new_buf
 *         self.len = new_size
 */
    PyErr_NoMemory(); __PYX_ERR(7, 52, __pyx_L1_error)

    /* "asynctnt/iproto/rbuffer.pyx":46
 *         # print('ReadBuffer reallocate: {}'.format(new_size))
 *         new_buf = <char*>PyMem_Realloc(<void*>self.buf, <size_t>new_size)
 *         if new_buf is NULL:             # <<<<<<<<<<<<<<
 *             PyMem_Free(self.buf)
 *             self.buf = NULL
 */
  }

  /* "asynctnt/iproto/rbuffer.pyx":53
 *             self.use = 0
 *             raise MemoryError
 *         self.buf = new_buf             # <<<<<<<<<<<<<<
 *         self.len = new_size
 * 
 */
  __pyx_v_self->buf = __pyx_v_new_buf;

  /* "asynctnt/iproto/rbuffer.pyx":54
 *             raise MemoryError
 *         self.buf = new_buf
 *         self.len = new_size             # <<<<<<<<<<<<<<
 * 
 *     cdef int extend(self, const char *data, size_t len) except -1:
 */
  __pyx_v_self->len = __pyx_v_new_size;

  /* "asynctnt/iproto/rbuffer.pyx":41
 *         self.use = 0
 * 
 *     cdef void _reallocate(self, size_t new_size) except *:             # <<<<<<<<<<<<<<
 *         cdef char *new_buf
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer._reallocate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/rbuffer.pyx":56
 *         self.len = new_size
 * 
 *     cdef int extend(self, const char *data, size_t len) except -1:             # <<<<<<<<<<<<<<
 *         cdef:
 *             size_t new_size
 */

static int __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_extend(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, char const *__pyx_v_data, size_t __pyx_v_len) {
  size_t __pyx_v_new_size;
  size_t __pyx_v_dealloc_threshold;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extend", 0);

  /* "asynctnt/iproto/rbuffer.pyx":60
 *             size_t new_size
 *             size_t dealloc_threshold
 *         new_size = self.use + len             # <<<<<<<<<<<<<<
 *         dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if new_size > self.len:
 */
  __pyx_v_new_size = (__pyx_v_self->use + __pyx_v_len);

  /* "asynctnt/iproto/rbuffer.pyx":61
 *             size_t dealloc_threshold
 *         new_size = self.use + len
 *         dealloc_threshold = self.len // _DEALLOCATE_RATIO             # <<<<<<<<<<<<<<
 *         if new_size > self.len:
 *             self._reallocate(
 */
  __pyx_v_dealloc_threshold = (__pyx_v_self->len / 4);

  /* "asynctnt/iproto/rbuffer.pyx":62
 *         new_size = self.use + len
 *         dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if new_size > self.len:             # <<<<<<<<<<<<<<
 *             self._reallocate(
 *                 size_t_max(nearest_power_of_2(new_size), self.len << 1)
 */
  __pyx_t_1 = ((__pyx_v_new_size > __pyx_v_self->len) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/rbuffer.pyx":63
 *         dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if new_size > self.len:
 *             self._reallocate(             # <<<<<<<<<<<<<<
 *                 size_t_max(nearest_power_of_2(new_size), self.len << 1)
 *             )
 */
    __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate(__pyx_v_self, __pyx_f_8asynctnt_6iproto_8protocol_size_t_max(__pyx_f_8asynctnt_6iproto_8protocol_nearest_power_of_2(__pyx_v_new_size), (__pyx_v_self->len << 1))); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 63, __pyx_L1_error)

    /* "asynctnt/iproto/rbuffer.pyx":62
 *         new_size = self.use + len
 *         dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if new_size > self.len:             # <<<<<<<<<<<<<<
 *             self._reallocate(
 *                 size_t_max(nearest_power_of_2(new_size), self.len << 1)
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/rbuffer.pyx":66
 *                 size_t_max(nearest_power_of_2(new_size), self.len << 1)
 *             )
 *         elif dealloc_threshold >= self.initial_buffer_size \             # <<<<<<<<<<<<<<
 *                 and new_size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)
 */
  __pyx_t_2 = ((__pyx_v_dealloc_threshold >= __pyx_v_self->initial_buffer_size) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asynctnt/iproto/rbuffer.pyx":67
 *             )
 *         elif dealloc_threshold >= self.initial_buffer_size \
 *                 and new_size < dealloc_threshold:             # <<<<<<<<<<<<<<
 *             self._reallocate(dealloc_threshold)
 * 
 */
  __pyx_t_2 = ((__pyx_v_new_size < __pyx_v_dealloc_threshold) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "asynctnt/iproto/rbuffer.pyx":66
 *                 size_t_max(nearest_power_of_2(new_size), self.len << 1)
 *             )
 *         elif dealloc_threshold >= self.initial_buffer_size \             # <<<<<<<<<<<<<<
 *                 and new_size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)
 */
  if (__pyx_t_1) {

    /* "asynctnt/iproto/rbuffer.pyx":68
 *         elif dealloc_threshold >= self.initial_buffer_size \
 *                 and new_size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)             # <<<<<<<<<<<<<<
 * 
 *         memcpy(&self.buf[self.use], data, len)
 */
    __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate(__pyx_v_self, __pyx_v_dealloc_threshold); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 68, __pyx_L1_error)

    /* "asynctnt/iproto/rbuffer.pyx":66
 *                 size_t_max(nearest_power_of_2(new_size), self.len << 1)
 *             )
 *         elif dealloc_threshold >= self.initial_buffer_size \             # <<<<<<<<<<<<<<
 *                 and new_size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)
 */
  }
  __pyx_L3:;

  /* "asynctnt/iproto/rbuffer.pyx":70
 *             self._reallocate(dealloc_threshold)
 * 
 *         memcpy(&self.buf[self.use], data, len)             # <<<<<<<<<<<<<<
 *         self.use += len
 *         return 0
 */
  (void)(memcpy((&(__pyx_v_self->buf[__pyx_v_self->use])), __pyx_v_data, __pyx_v_len));

  /* "asynctnt/iproto/rbuffer.pyx":71
 * 
 *         memcpy(&self.buf[self.use], data, len)
 *         self.use += len             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_v_self->use = (__pyx_v_self->use + __pyx_v_len);

  /* "asynctnt/iproto/rbuffer.pyx":72
 *         memcpy(&self.buf[self.use], data, len)
 *         self.use += len
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef void move(self, size_t pos):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pyx":56
 *         self.len = new_size
 * 
 *     cdef int extend(self, const char *data, size_t len) except -1:             # <<<<<<<<<<<<<<
 *         cdef:
 *             size_t new_size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/rbuffer.pyx":74
 *         return 0
 * 
 *     cdef void move(self, size_t pos):             # <<<<<<<<<<<<<<
 *         cdef size_t delta = self.use - pos
 *         memmove(self.buf, &self.buf[pos], delta)
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_pos) {
  size_t __pyx_v_delta;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("move", 0);

  /* "asynctnt/iproto/rbuffer.pyx":75
 * 
 *     cdef void move(self, size_t pos):
 *         cdef size_t delta = self.use - pos             # <<<<<<<<<<<<<<
 *         memmove(self.buf, &self.buf[pos], delta)
 *         self.use = delta
 */
  __pyx_v_delta = (__pyx_v_self->use - __pyx_v_pos);

  /* "asynctnt/iproto/rbuffer.pyx":76
 *     cdef void move(self, size_t pos):
 *         cdef size_t delta = self.use - pos
 *         memmove(self.buf, &self.buf[pos], delta)             # <<<<<<<<<<<<<<
 *         self.use = delta
 * 
 */
  (void)(memmove(__pyx_v_self->buf, (&(__pyx_v_self->buf[__pyx_v_pos])), __pyx_v_delta));

  /* "asynctnt/iproto/rbuffer.pyx":77
 *         cdef size_t delta = self.use - pos
 *         memmove(self.buf, &self.buf[pos], delta)
 *         self.use = delta             # <<<<<<<<<<<<<<
 * 
 *     cdef void move_offset(self, ssize_t offset, size_t size) except *:
 */
  __pyx_v_self->use = __pyx_v_delta;

  /* "asynctnt/iproto/rbuffer.pyx":74
 *         return 0
 * 
 *     cdef void move(self, size_t pos):             # <<<<<<<<<<<<<<
 *         cdef size_t delta = self.use - pos
 *         memmove(self.buf, &self.buf[pos], delta)
 */

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

/* "asynctnt/iproto/rbuffer.pyx":79
 *         self.use = delta
 * 
 *     cdef void move_offset(self, ssize_t offset, size_t size) except *:             # <<<<<<<<<<<<<<
 *         cdef size_t dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if offset == 0:
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move_offset(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_offset, size_t __pyx_v_size) {
  size_t __pyx_v_dealloc_threshold;
  __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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("move_offset", 0);

  /* "asynctnt/iproto/rbuffer.pyx":80
 * 
 *     cdef void move_offset(self, ssize_t offset, size_t size) except *:
 *         cdef size_t dealloc_threshold = self.len // _DEALLOCATE_RATIO             # <<<<<<<<<<<<<<
 *         if offset == 0:
 *             return
 */
  __pyx_v_dealloc_threshold = (__pyx_v_self->len / 4);

  /* "asynctnt/iproto/rbuffer.pyx":81
 *     cdef void move_offset(self, ssize_t offset, size_t size) except *:
 *         cdef size_t dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return
 *         assert offset > 0, \
 */
  __pyx_t_1 = ((__pyx_v_offset == 0) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/rbuffer.pyx":82
 *         cdef size_t dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if offset == 0:
 *             return             # <<<<<<<<<<<<<<
 *         assert offset > 0, \
 *             'Offset incorrect. Got: {}. use:{}, len:{}'.format(
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/rbuffer.pyx":81
 *     cdef void move_offset(self, ssize_t offset, size_t size) except *:
 *         cdef size_t dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return
 *         assert offset > 0, \
 */
  }

  /* "asynctnt/iproto/rbuffer.pyx":83
 *         if offset == 0:
 *             return
 *         assert offset > 0, \             # <<<<<<<<<<<<<<
 *             'Offset incorrect. Got: {}. use:{}, len:{}'.format(
 *                 offset, self.use, self.len
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_offset > 0) != 0))) {

      /* "asynctnt/iproto/rbuffer.pyx":84
 *             return
 *         assert offset > 0, \
 *             'Offset incorrect. Got: {}. use:{}, len:{}'.format(             # <<<<<<<<<<<<<<
 *                 offset, self.use, self.len
 *             )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Offset_incorrect_Got_use_len, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "asynctnt/iproto/rbuffer.pyx":85
 *         assert offset > 0, \
 *             'Offset incorrect. Got: {}. use:{}, len:{}'.format(
 *                 offset, self.use, self.len             # <<<<<<<<<<<<<<
 *             )
 *         memmove(self.buf, &self.buf[offset], size)
 */
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_self->use); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->len); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && 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);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 84, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __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_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 84, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __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_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 84, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6);
        __pyx_t_4 = 0;
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 84, __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;

      /* "asynctnt/iproto/rbuffer.pyx":84
 *             return
 *         assert offset > 0, \
 *             'Offset incorrect. Got: {}. use:{}, len:{}'.format(             # <<<<<<<<<<<<<<
 *                 offset, self.use, self.len
 *             )
 */
      __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(7, 83, __pyx_L1_error)
    }
  }
  #endif

  /* "asynctnt/iproto/rbuffer.pyx":87
 *                 offset, self.use, self.len
 *             )
 *         memmove(self.buf, &self.buf[offset], size)             # <<<<<<<<<<<<<<
 * 
 *         if dealloc_threshold >= self.initial_buffer_size \
 */
  (void)(memmove(__pyx_v_self->buf, (&(__pyx_v_self->buf[__pyx_v_offset])), __pyx_v_size));

  /* "asynctnt/iproto/rbuffer.pyx":89
 *         memmove(self.buf, &self.buf[offset], size)
 * 
 *         if dealloc_threshold >= self.initial_buffer_size \             # <<<<<<<<<<<<<<
 *                 and size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)
 */
  __pyx_t_10 = ((__pyx_v_dealloc_threshold >= __pyx_v_self->initial_buffer_size) != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_1 = __pyx_t_10;
    goto __pyx_L5_bool_binop_done;
  }

  /* "asynctnt/iproto/rbuffer.pyx":90
 * 
 *         if dealloc_threshold >= self.initial_buffer_size \
 *                 and size < dealloc_threshold:             # <<<<<<<<<<<<<<
 *             self._reallocate(dealloc_threshold)
 * 
 */
  __pyx_t_10 = ((__pyx_v_size < __pyx_v_dealloc_threshold) != 0);
  __pyx_t_1 = __pyx_t_10;
  __pyx_L5_bool_binop_done:;

  /* "asynctnt/iproto/rbuffer.pyx":89
 *         memmove(self.buf, &self.buf[offset], size)
 * 
 *         if dealloc_threshold >= self.initial_buffer_size \             # <<<<<<<<<<<<<<
 *                 and size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)
 */
  if (__pyx_t_1) {

    /* "asynctnt/iproto/rbuffer.pyx":91
 *         if dealloc_threshold >= self.initial_buffer_size \
 *                 and size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes get_slice(self, size_t begin, size_t end):
 */
    __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate(__pyx_v_self, __pyx_v_dealloc_threshold); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 91, __pyx_L1_error)

    /* "asynctnt/iproto/rbuffer.pyx":89
 *         memmove(self.buf, &self.buf[offset], size)
 * 
 *         if dealloc_threshold >= self.initial_buffer_size \             # <<<<<<<<<<<<<<
 *                 and size < dealloc_threshold:
 *             self._reallocate(dealloc_threshold)
 */
  }

  /* "asynctnt/iproto/rbuffer.pyx":79
 *         self.use = delta
 * 
 *     cdef void move_offset(self, ssize_t offset, size_t size) except *:             # <<<<<<<<<<<<<<
 *         cdef size_t dealloc_threshold = self.len // _DEALLOCATE_RATIO
 *         if offset == 0:
 */

  /* function exit code */
  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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.move_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/rbuffer.pyx":93
 *             self._reallocate(dealloc_threshold)
 * 
 *     cdef bytes get_slice(self, size_t begin, size_t end):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ssize_t diff
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_begin, size_t __pyx_v_end) {
  Py_ssize_t __pyx_v_diff;
  char *__pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice", 0);

  /* "asynctnt/iproto/rbuffer.pyx":97
 *             ssize_t diff
 *             char *p
 *         p = &self.buf[begin]             # <<<<<<<<<<<<<<
 *         diff = end - begin
 *         return <bytes>p[:diff]
 */
  __pyx_v_p = (&(__pyx_v_self->buf[__pyx_v_begin]));

  /* "asynctnt/iproto/rbuffer.pyx":98
 *             char *p
 *         p = &self.buf[begin]
 *         diff = end - begin             # <<<<<<<<<<<<<<
 *         return <bytes>p[:diff]
 * 
 */
  __pyx_v_diff = (__pyx_v_end - __pyx_v_begin);

  /* "asynctnt/iproto/rbuffer.pyx":99
 *         p = &self.buf[begin]
 *         diff = end - begin
 *         return <bytes>p[:diff]             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes get_slice_begin(self, size_t begin):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_p + 0, __pyx_v_diff - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_t_1));
  __pyx_r = ((PyObject*)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pyx":93
 *             self._reallocate(dealloc_threshold)
 * 
 *     cdef bytes get_slice(self, size_t begin, size_t end):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ssize_t diff
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.get_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/rbuffer.pyx":101
 *         return <bytes>p[:diff]
 * 
 *     cdef bytes get_slice_begin(self, size_t begin):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ssize_t diff
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_begin(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_begin) {
  Py_ssize_t __pyx_v_diff;
  char *__pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_begin", 0);

  /* "asynctnt/iproto/rbuffer.pyx":105
 *             ssize_t diff
 *             char *p
 *         p = &self.buf[begin]             # <<<<<<<<<<<<<<
 *         diff = self.use - begin
 *         return <bytes>p[:diff]
 */
  __pyx_v_p = (&(__pyx_v_self->buf[__pyx_v_begin]));

  /* "asynctnt/iproto/rbuffer.pyx":106
 *             char *p
 *         p = &self.buf[begin]
 *         diff = self.use - begin             # <<<<<<<<<<<<<<
 *         return <bytes>p[:diff]
 * 
 */
  __pyx_v_diff = (__pyx_v_self->use - __pyx_v_begin);

  /* "asynctnt/iproto/rbuffer.pyx":107
 *         p = &self.buf[begin]
 *         diff = self.use - begin
 *         return <bytes>p[:diff]             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes get_slice_end(self, size_t end):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_p + 0, __pyx_v_diff - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_t_1));
  __pyx_r = ((PyObject*)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pyx":101
 *         return <bytes>p[:diff]
 * 
 *     cdef bytes get_slice_begin(self, size_t begin):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ssize_t diff
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.get_slice_begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/rbuffer.pyx":109
 *         return <bytes>p[:diff]
 * 
 *     cdef bytes get_slice_end(self, size_t end):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ssize_t diff
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_end(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, size_t __pyx_v_end) {
  Py_ssize_t __pyx_v_diff;
  char *__pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_end", 0);

  /* "asynctnt/iproto/rbuffer.pyx":113
 *             ssize_t diff
 *             char *p
 *         p = &self.buf[0]             # <<<<<<<<<<<<<<
 *         diff = end - 0
 *         return <bytes>p[:diff]
 */
  __pyx_v_p = (&(__pyx_v_self->buf[0]));

  /* "asynctnt/iproto/rbuffer.pyx":114
 *             char *p
 *         p = &self.buf[0]
 *         diff = end - 0             # <<<<<<<<<<<<<<
 *         return <bytes>p[:diff]
 */
  __pyx_v_diff = (__pyx_v_end - 0);

  /* "asynctnt/iproto/rbuffer.pyx":115
 *         p = &self.buf[0]
 *         diff = end - 0
 *         return <bytes>p[:diff]             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_p + 0, __pyx_v_diff - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_t_1));
  __pyx_r = ((PyObject*)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pyx":109
 *         return <bytes>p[:diff]
 * 
 *     cdef bytes get_slice_end(self, size_t end):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ssize_t diff
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.get_slice_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_4__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_6__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_10ReadBuffer_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.ReadBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/request.pyx":9
 * cdef class Request:
 *     @staticmethod
 *     cdef inline Request new(tarantool.iproto_type op,             # <<<<<<<<<<<<<<
 *                             uint64_t sync, int64_t schema_id,
 *                             SchemaSpace space, bint push_subscribe):
 */

static CYTHON_INLINE struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op, uint64_t __pyx_v_sync, int64_t __pyx_v_schema_id, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, int __pyx_v_push_subscribe) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 0);

  /* "asynctnt/iproto/request.pyx":13
 *                             SchemaSpace space, bint push_subscribe):
 *         cdef Request req
 *         req = Request.__new__(Request)             # <<<<<<<<<<<<<<
 *         req.op = op
 *         req.sync = sync
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_Request(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_Request), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_req = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/request.pyx":14
 *         cdef Request req
 *         req = Request.__new__(Request)
 *         req.op = op             # <<<<<<<<<<<<<<
 *         req.sync = sync
 *         req.schema_id = schema_id
 */
  __pyx_v_req->op = __pyx_v_op;

  /* "asynctnt/iproto/request.pyx":15
 *         req = Request.__new__(Request)
 *         req.op = op
 *         req.sync = sync             # <<<<<<<<<<<<<<
 *         req.schema_id = schema_id
 *         req.space = space
 */
  __pyx_v_req->sync = __pyx_v_sync;

  /* "asynctnt/iproto/request.pyx":16
 *         req.op = op
 *         req.sync = sync
 *         req.schema_id = schema_id             # <<<<<<<<<<<<<<
 *         req.space = space
 *         req.waiter = None
 */
  __pyx_v_req->schema_id = __pyx_v_schema_id;

  /* "asynctnt/iproto/request.pyx":17
 *         req.sync = sync
 *         req.schema_id = schema_id
 *         req.space = space             # <<<<<<<<<<<<<<
 *         req.waiter = None
 *         req.timeout_handle = None
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_space));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_space));
  __Pyx_GOTREF(__pyx_v_req->space);
  __Pyx_DECREF(((PyObject *)__pyx_v_req->space));
  __pyx_v_req->space = __pyx_v_space;

  /* "asynctnt/iproto/request.pyx":18
 *         req.schema_id = schema_id
 *         req.space = space
 *         req.waiter = None             # <<<<<<<<<<<<<<
 *         req.timeout_handle = None
 *         req.parse_as_tuples = space is not None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_req->waiter);
  __Pyx_DECREF(__pyx_v_req->waiter);
  __pyx_v_req->waiter = Py_None;

  /* "asynctnt/iproto/request.pyx":19
 *         req.space = space
 *         req.waiter = None
 *         req.timeout_handle = None             # <<<<<<<<<<<<<<
 *         req.parse_as_tuples = space is not None
 *         req.parse_metadata = True
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_req->timeout_handle);
  __Pyx_DECREF(__pyx_v_req->timeout_handle);
  __pyx_v_req->timeout_handle = Py_None;

  /* "asynctnt/iproto/request.pyx":20
 *         req.waiter = None
 *         req.timeout_handle = None
 *         req.parse_as_tuples = space is not None             # <<<<<<<<<<<<<<
 *         req.parse_metadata = True
 *         req.push_subscribe = push_subscribe
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_space) != Py_None);
  __pyx_v_req->parse_as_tuples = __pyx_t_2;

  /* "asynctnt/iproto/request.pyx":21
 *         req.timeout_handle = None
 *         req.parse_as_tuples = space is not None
 *         req.parse_metadata = True             # <<<<<<<<<<<<<<
 *         req.push_subscribe = push_subscribe
 *         req.response = None
 */
  __pyx_v_req->parse_metadata = 1;

  /* "asynctnt/iproto/request.pyx":22
 *         req.parse_as_tuples = space is not None
 *         req.parse_metadata = True
 *         req.push_subscribe = push_subscribe             # <<<<<<<<<<<<<<
 *         req.response = None
 *         return req
 */
  __pyx_v_req->push_subscribe = __pyx_v_push_subscribe;

  /* "asynctnt/iproto/request.pyx":23
 *         req.parse_metadata = True
 *         req.push_subscribe = push_subscribe
 *         req.response = None             # <<<<<<<<<<<<<<
 *         return req
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_req->response);
  __Pyx_DECREF(((PyObject *)__pyx_v_req->response));
  __pyx_v_req->response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)Py_None);

  /* "asynctnt/iproto/request.pyx":24
 *         req.push_subscribe = push_subscribe
 *         req.response = None
 *         return req             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):  # pragma: nocover
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_req));
  __pyx_r = __pyx_v_req;
  goto __pyx_L0;

  /* "asynctnt/iproto/request.pyx":9
 * cdef class Request:
 *     @staticmethod
 *     cdef inline Request new(tarantool.iproto_type op,             # <<<<<<<<<<<<<<
 *                             uint64_t sync, int64_t schema_id,
 *                             SchemaSpace space, bint push_subscribe):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Request.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/request.pyx":26
 *         return req
 * 
 *     def __repr__(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         return \
 *             '<Request op={} sync={} schema_id={} push_subscribe={}>'.format(
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7Request_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7Request_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_7Request___repr__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_7Request___repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self) {
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "asynctnt/iproto/request.pyx":27
 * 
 *     def __repr__(self):  # pragma: nocover
 *         return \             # <<<<<<<<<<<<<<
 *             '<Request op={} sync={} schema_id={} push_subscribe={}>'.format(
 *                 self.op,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/request.pyx":28
 *     def __repr__(self):  # pragma: nocover
 *         return \
 *             '<Request op={} sync={} schema_id={} push_subscribe={}>'.format(             # <<<<<<<<<<<<<<
 *                 self.op,
 *                 self.sync,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Request_op_sync_schema_id_push, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/request.pyx":29
 *         return \
 *             '<Request op={} sync={} schema_id={} push_subscribe={}>'.format(
 *                 self.op,             # <<<<<<<<<<<<<<
 *                 self.sync,
 *                 self.schema_id,
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(__pyx_v_self->op); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "asynctnt/iproto/request.pyx":30
 *             '<Request op={} sync={} schema_id={} push_subscribe={}>'.format(
 *                 self.op,
 *                 self.sync,             # <<<<<<<<<<<<<<
 *                 self.schema_id,
 *                 self.push_subscribe
 */
  __pyx_t_4 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->sync); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "asynctnt/iproto/request.pyx":31
 *                 self.op,
 *                 self.sync,
 *                 self.schema_id,             # <<<<<<<<<<<<<<
 *                 self.push_subscribe
 *             )
 */
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->schema_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "asynctnt/iproto/request.pyx":32
 *                 self.sync,
 *                 self.schema_id,
 *                 self.push_subscribe             # <<<<<<<<<<<<<<
 *             )
 */
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->push_subscribe); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 28, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __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_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 28, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __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_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __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+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/request.pyx":26
 *         return req
 * 
 *     def __repr__(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         return \
 *             '<Request op={} sync={} schema_id={} push_subscribe={}>'.format(
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Request.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7Request_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7Request_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_7Request_2__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_7Request_2__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.op, self.parse_as_tuples, self.parse_metadata, self.push_subscribe, self.response, self.schema_id, self.space, self.sync, self.timeout_handle, self.waiter)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(__pyx_v_self->op); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->parse_as_tuples); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->parse_metadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->push_subscribe); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->schema_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->sync); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(10); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->response));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->response));
  PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_self->response));
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->space));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->space));
  PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_v_self->space));
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->timeout_handle);
  __Pyx_GIVEREF(__pyx_v_self->timeout_handle);
  PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_v_self->timeout_handle);
  __Pyx_INCREF(__pyx_v_self->waiter);
  __Pyx_GIVEREF(__pyx_v_self->waiter);
  PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_v_self->waiter);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.op, self.parse_as_tuples, self.parse_metadata, self.push_subscribe, self.response, self.schema_id, self.space, self.sync, self.timeout_handle, self.waiter)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v__dict = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "(tree fragment)":7
 *     state = (self.op, self.parse_as_tuples, self.parse_metadata, self.push_subscribe, self.response, self.schema_id, self.space, self.sync, self.timeout_handle, self.waiter)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_8 = (__pyx_v__dict != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.response is not None or self.space is not None or self.timeout_handle is not None or self.waiter is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.op, self.parse_as_tuples, self.parse_metadata, self.push_subscribe, self.response, self.schema_id, self.space, self.sync, self.timeout_handle, self.waiter)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.response is not None or self.space is not None or self.timeout_handle is not None or self.waiter is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, None), state
 */
  /*else*/ {
    __pyx_t_8 = (((PyObject *)__pyx_v_self->response) != Py_None);
    __pyx_t_10 = (__pyx_t_8 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (((PyObject *)__pyx_v_self->space) != Py_None);
    __pyx_t_8 = (__pyx_t_10 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_9 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->timeout_handle != Py_None);
    __pyx_t_10 = (__pyx_t_8 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->waiter != Py_None);
    __pyx_t_8 = (__pyx_t_10 != 0);
    __pyx_t_9 = __pyx_t_8;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_9;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.response is not None or self.space is not None or self.timeout_handle is not None or self.waiter is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, None), state
 *     else:
 */
  __pyx_t_9 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_9) {

    /* "(tree fragment)":13
 *         use_setstate = self.response is not None or self.space is not None or self.timeout_handle is not None or self.waiter is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Request); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_2045263);
    __Pyx_GIVEREF(__pyx_int_2045263);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_2045263);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.response is not None or self.space is not None or self.timeout_handle is not None or self.waiter is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, None), state
 *     else:
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Request__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Request); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_2045263);
    __Pyx_GIVEREF(__pyx_int_2045263);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_2045263);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Request.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Request__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7Request_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7Request_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_7Request_4__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_7Request_4__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Request__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_Request__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Request, (type(self), 0x01f354f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Request__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Request.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":22
 *     """
 * 
 *     def __cinit__(self, bytes encoding, bint push_subscribe):             # <<<<<<<<<<<<<<
 *         self._sync = 0
 *         self._code = -1
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_8Response_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_8Response_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_encoding = 0;
  int __pyx_v_push_subscribe;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,&__pyx_n_s_push_subscribe,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);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_push_subscribe)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(3, 22, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 22, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
    __pyx_v_push_subscribe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_push_subscribe == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 22, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 22, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyBytes_Type), 1, "encoding", 1))) __PYX_ERR(3, 22, __pyx_L1_error)
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self), __pyx_v_encoding, __pyx_v_push_subscribe);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8asynctnt_6iproto_8protocol_8Response___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_encoding, int __pyx_v_push_subscribe) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("__cinit__", 0);

  /* "asynctnt/iproto/response.pyx":23
 * 
 *     def __cinit__(self, bytes encoding, bint push_subscribe):
 *         self._sync = 0             # <<<<<<<<<<<<<<
 *         self._code = -1
 *         self._return_code = -1
 */
  __pyx_v_self->_sync = 0;

  /* "asynctnt/iproto/response.pyx":24
 *     def __cinit__(self, bytes encoding, bint push_subscribe):
 *         self._sync = 0
 *         self._code = -1             # <<<<<<<<<<<<<<
 *         self._return_code = -1
 *         self._schema_id = -1
 */
  __pyx_v_self->_code = -1;

  /* "asynctnt/iproto/response.pyx":25
 *         self._sync = 0
 *         self._code = -1
 *         self._return_code = -1             # <<<<<<<<<<<<<<
 *         self._schema_id = -1
 *         self._errmsg = None
 */
  __pyx_v_self->_return_code = -1;

  /* "asynctnt/iproto/response.pyx":26
 *         self._code = -1
 *         self._return_code = -1
 *         self._schema_id = -1             # <<<<<<<<<<<<<<
 *         self._errmsg = None
 *         self._rowcount = 0
 */
  __pyx_v_self->_schema_id = -1L;

  /* "asynctnt/iproto/response.pyx":27
 *         self._return_code = -1
 *         self._schema_id = -1
 *         self._errmsg = None             # <<<<<<<<<<<<<<
 *         self._rowcount = 0
 *         self._body = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_errmsg);
  __Pyx_DECREF(__pyx_v_self->_errmsg);
  __pyx_v_self->_errmsg = ((PyObject*)Py_None);

  /* "asynctnt/iproto/response.pyx":28
 *         self._schema_id = -1
 *         self._errmsg = None
 *         self._rowcount = 0             # <<<<<<<<<<<<<<
 *         self._body = None
 *         self._encoding = encoding
 */
  __pyx_v_self->_rowcount = 0;

  /* "asynctnt/iproto/response.pyx":29
 *         self._errmsg = None
 *         self._rowcount = 0
 *         self._body = None             # <<<<<<<<<<<<<<
 *         self._encoding = encoding
 *         self._fields = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_body);
  __Pyx_DECREF(__pyx_v_self->_body);
  __pyx_v_self->_body = ((PyObject*)Py_None);

  /* "asynctnt/iproto/response.pyx":30
 *         self._rowcount = 0
 *         self._body = None
 *         self._encoding = encoding             # <<<<<<<<<<<<<<
 *         self._fields = None
 *         self._autoincrement_ids = None
 */
  __Pyx_INCREF(__pyx_v_encoding);
  __Pyx_GIVEREF(__pyx_v_encoding);
  __Pyx_GOTREF(__pyx_v_self->_encoding);
  __Pyx_DECREF(__pyx_v_self->_encoding);
  __pyx_v_self->_encoding = __pyx_v_encoding;

  /* "asynctnt/iproto/response.pyx":31
 *         self._body = None
 *         self._encoding = encoding
 *         self._fields = None             # <<<<<<<<<<<<<<
 *         self._autoincrement_ids = None
 *         self._push_subscribe = push_subscribe
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_fields);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_fields));
  __pyx_v_self->_fields = ((struct C_TntFields *)Py_None);

  /* "asynctnt/iproto/response.pyx":32
 *         self._encoding = encoding
 *         self._fields = None
 *         self._autoincrement_ids = None             # <<<<<<<<<<<<<<
 *         self._push_subscribe = push_subscribe
 *         if push_subscribe:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_autoincrement_ids);
  __Pyx_DECREF(__pyx_v_self->_autoincrement_ids);
  __pyx_v_self->_autoincrement_ids = ((PyObject*)Py_None);

  /* "asynctnt/iproto/response.pyx":33
 *         self._fields = None
 *         self._autoincrement_ids = None
 *         self._push_subscribe = push_subscribe             # <<<<<<<<<<<<<<
 *         if push_subscribe:
 *             self._q = collections.deque()
 */
  __pyx_v_self->_push_subscribe = __pyx_v_push_subscribe;

  /* "asynctnt/iproto/response.pyx":34
 *         self._autoincrement_ids = None
 *         self._push_subscribe = push_subscribe
 *         if push_subscribe:             # <<<<<<<<<<<<<<
 *             self._q = collections.deque()
 *             self._push_event = asyncio.Event()
 */
  __pyx_t_1 = (__pyx_v_push_subscribe != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/response.pyx":35
 *         self._push_subscribe = push_subscribe
 *         if push_subscribe:
 *             self._q = collections.deque()             # <<<<<<<<<<<<<<
 *             self._push_event = asyncio.Event()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(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);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_q);
    __Pyx_DECREF(__pyx_v_self->_q);
    __pyx_v_self->_q = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/response.pyx":36
 *         if push_subscribe:
 *             self._q = collections.deque()
 *             self._push_event = asyncio.Event()             # <<<<<<<<<<<<<<
 * 
 *             self._q_append = self._q.append
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Event); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(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);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_push_event);
    __Pyx_DECREF(__pyx_v_self->_push_event);
    __pyx_v_self->_push_event = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/response.pyx":38
 *             self._push_event = asyncio.Event()
 * 
 *             self._q_append = self._q.append             # <<<<<<<<<<<<<<
 *             self._q_popleft = self._q.popleft
 *             self._push_event_set = self._push_event.set
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_q, __pyx_n_s_append); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_q_append);
    __Pyx_DECREF(__pyx_v_self->_q_append);
    __pyx_v_self->_q_append = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/response.pyx":39
 * 
 *             self._q_append = self._q.append
 *             self._q_popleft = self._q.popleft             # <<<<<<<<<<<<<<
 *             self._push_event_set = self._push_event.set
 *             self._push_event_clear = self._push_event.clear
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_q, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_q_popleft);
    __Pyx_DECREF(__pyx_v_self->_q_popleft);
    __pyx_v_self->_q_popleft = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/response.pyx":40
 *             self._q_append = self._q.append
 *             self._q_popleft = self._q.popleft
 *             self._push_event_set = self._push_event.set             # <<<<<<<<<<<<<<
 *             self._push_event_clear = self._push_event.clear
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_push_event, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_push_event_set);
    __Pyx_DECREF(__pyx_v_self->_push_event_set);
    __pyx_v_self->_push_event_set = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/response.pyx":41
 *             self._q_popleft = self._q.popleft
 *             self._push_event_set = self._push_event.set
 *             self._push_event_clear = self._push_event.clear             # <<<<<<<<<<<<<<
 *         else:
 *             self._q = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_push_event, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_push_event_clear);
    __Pyx_DECREF(__pyx_v_self->_push_event_clear);
    __pyx_v_self->_push_event_clear = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asynctnt/iproto/response.pyx":34
 *         self._autoincrement_ids = None
 *         self._push_subscribe = push_subscribe
 *         if push_subscribe:             # <<<<<<<<<<<<<<
 *             self._q = collections.deque()
 *             self._push_event = asyncio.Event()
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/response.pyx":43
 *             self._push_event_clear = self._push_event.clear
 *         else:
 *             self._q = None             # <<<<<<<<<<<<<<
 *             self._push_event = None
 * 
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->_q);
    __Pyx_DECREF(__pyx_v_self->_q);
    __pyx_v_self->_q = Py_None;

    /* "asynctnt/iproto/response.pyx":44
 *         else:
 *             self._q = None
 *             self._push_event = None             # <<<<<<<<<<<<<<
 * 
 *     cdef inline bint is_error(self):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->_push_event);
    __Pyx_DECREF(__pyx_v_self->_push_event);
    __pyx_v_self->_push_event = Py_None;
  }
  __pyx_L3:;

  /* "asynctnt/iproto/response.pyx":22
 *     """
 * 
 *     def __cinit__(self, bytes encoding, bint push_subscribe):             # <<<<<<<<<<<<<<
 *         self._sync = 0
 *         self._code = -1
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":46
 *             self._push_event = None
 * 
 *     cdef inline bint is_error(self):             # <<<<<<<<<<<<<<
 *         return self._code >= 0x8000
 * 
 */

static CYTHON_INLINE int __pyx_f_8asynctnt_6iproto_8protocol_8Response_is_error(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_error", 0);

  /* "asynctnt/iproto/response.pyx":47
 * 
 *     cdef inline bint is_error(self):
 *         return self._code >= 0x8000             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void add_push(self, push):
 */
  __pyx_r = (__pyx_v_self->_code >= 0x8000);
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":46
 *             self._push_event = None
 * 
 *     cdef inline bint is_error(self):             # <<<<<<<<<<<<<<
 *         return self._code >= 0x8000
 * 
 */

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

/* "asynctnt/iproto/response.pyx":49
 *         return self._code >= 0x8000
 * 
 *     cdef inline void add_push(self, push):             # <<<<<<<<<<<<<<
 *         if not self._push_subscribe:
 *             return
 */

static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_add_push(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_push) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("add_push", 0);

  /* "asynctnt/iproto/response.pyx":50
 * 
 *     cdef inline void add_push(self, push):
 *         if not self._push_subscribe:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->_push_subscribe != 0)) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/response.pyx":51
 *     cdef inline void add_push(self, push):
 *         if not self._push_subscribe:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._q_append(push)
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":50
 * 
 *     cdef inline void add_push(self, push):
 *         if not self._push_subscribe:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/response.pyx":53
 *             return
 * 
 *         self._q_append(push)             # <<<<<<<<<<<<<<
 *         self.notify()
 * 
 */
  __Pyx_INCREF(__pyx_v_self->_q_append);
  __pyx_t_3 = __pyx_v_self->_q_append; __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_push) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_push);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 53, __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;

  /* "asynctnt/iproto/response.pyx":54
 * 
 *         self._q_append(push)
 *         self.notify()             # <<<<<<<<<<<<<<
 * 
 *     cdef inline object push_len(self):
 */
  __pyx_f_8asynctnt_6iproto_8protocol_8Response_notify(__pyx_v_self);

  /* "asynctnt/iproto/response.pyx":49
 *         return self._code >= 0x8000
 * 
 *     cdef inline void add_push(self, push):             # <<<<<<<<<<<<<<
 *         if not self._push_subscribe:
 *             return
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.Response.add_push", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/response.pyx":56
 *         self.notify()
 * 
 *     cdef inline object push_len(self):             # <<<<<<<<<<<<<<
 *         return len(self._q)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("push_len", 0);

  /* "asynctnt/iproto/response.pyx":57
 * 
 *     cdef inline object push_len(self):
 *         return len(self._q)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline object pop_push(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_q;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":56
 *         self.notify()
 * 
 *     cdef inline object push_len(self):             # <<<<<<<<<<<<<<
 *         return len(self._q)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.push_len", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":59
 *         return len(self._q)
 * 
 *     cdef inline object pop_push(self):             # <<<<<<<<<<<<<<
 *         if not self._push_subscribe:
 *             raise RuntimeError('Cannot pop push from a non-async response')
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_pop_push(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_v_push = 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;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pop_push", 0);

  /* "asynctnt/iproto/response.pyx":60
 * 
 *     cdef inline object pop_push(self):
 *         if not self._push_subscribe:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Cannot pop push from a non-async response')
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->_push_subscribe != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/response.pyx":61
 *     cdef inline object pop_push(self):
 *         if not self._push_subscribe:
 *             raise RuntimeError('Cannot pop push from a non-async response')             # <<<<<<<<<<<<<<
 * 
 *         push = self._q_popleft()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 61, __pyx_L1_error)

    /* "asynctnt/iproto/response.pyx":60
 * 
 *     cdef inline object pop_push(self):
 *         if not self._push_subscribe:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Cannot pop push from a non-async response')
 * 
 */
  }

  /* "asynctnt/iproto/response.pyx":63
 *             raise RuntimeError('Cannot pop push from a non-async response')
 * 
 *         push = self._q_popleft()             # <<<<<<<<<<<<<<
 *         if len(self._q) == 0:
 *             self._push_event_clear()
 */
  __Pyx_INCREF(__pyx_v_self->_q_popleft);
  __pyx_t_3 = __pyx_v_self->_q_popleft; __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_push = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/response.pyx":64
 * 
 *         push = self._q_popleft()
 *         if len(self._q) == 0:             # <<<<<<<<<<<<<<
 *             self._push_event_clear()
 *         return push
 */
  __pyx_t_2 = __pyx_v_self->_q;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = ((__pyx_t_5 == 0) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/response.pyx":65
 *         push = self._q_popleft()
 *         if len(self._q) == 0:
 *             self._push_event_clear()             # <<<<<<<<<<<<<<
 *         return push
 * 
 */
    __Pyx_INCREF(__pyx_v_self->_push_event_clear);
    __pyx_t_3 = __pyx_v_self->_push_event_clear; __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 65, __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;

    /* "asynctnt/iproto/response.pyx":64
 * 
 *         push = self._q_popleft()
 *         if len(self._q) == 0:             # <<<<<<<<<<<<<<
 *             self._push_event_clear()
 *         return push
 */
  }

  /* "asynctnt/iproto/response.pyx":66
 *         if len(self._q) == 0:
 *             self._push_event_clear()
 *         return push             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void set_data(self, list data):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_push);
  __pyx_r = __pyx_v_push;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":59
 *         return len(self._q)
 * 
 *     cdef inline object pop_push(self):             # <<<<<<<<<<<<<<
 *         if not self._push_subscribe:
 *             raise RuntimeError('Cannot pop push from a non-async response')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.pop_push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_push);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":68
 *         return push
 * 
 *     cdef inline void set_data(self, list data):             # <<<<<<<<<<<<<<
 *         self._body = data
 *         self.notify()
 */

static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_data(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_data) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_data", 0);

  /* "asynctnt/iproto/response.pyx":69
 * 
 *     cdef inline void set_data(self, list data):
 *         self._body = data             # <<<<<<<<<<<<<<
 *         self.notify()
 * 
 */
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  __Pyx_GOTREF(__pyx_v_self->_body);
  __Pyx_DECREF(__pyx_v_self->_body);
  __pyx_v_self->_body = __pyx_v_data;

  /* "asynctnt/iproto/response.pyx":70
 *     cdef inline void set_data(self, list data):
 *         self._body = data
 *         self.notify()             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void set_exception(self, exc):
 */
  __pyx_f_8asynctnt_6iproto_8protocol_8Response_notify(__pyx_v_self);

  /* "asynctnt/iproto/response.pyx":68
 *         return push
 * 
 *     cdef inline void set_data(self, list data):             # <<<<<<<<<<<<<<
 *         self._body = data
 *         self.notify()
 */

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

/* "asynctnt/iproto/response.pyx":72
 *         self.notify()
 * 
 *     cdef inline void set_exception(self, exc):             # <<<<<<<<<<<<<<
 *         self._exception = exc
 *         self.notify()
 */

static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_exc) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_exception", 0);

  /* "asynctnt/iproto/response.pyx":73
 * 
 *     cdef inline void set_exception(self, exc):
 *         self._exception = exc             # <<<<<<<<<<<<<<
 *         self.notify()
 * 
 */
  __Pyx_INCREF(__pyx_v_exc);
  __Pyx_GIVEREF(__pyx_v_exc);
  __Pyx_GOTREF(__pyx_v_self->_exception);
  __Pyx_DECREF(__pyx_v_self->_exception);
  __pyx_v_self->_exception = __pyx_v_exc;

  /* "asynctnt/iproto/response.pyx":74
 *     cdef inline void set_exception(self, exc):
 *         self._exception = exc
 *         self.notify()             # <<<<<<<<<<<<<<
 * 
 *     cdef inline object get_exception(self):
 */
  __pyx_f_8asynctnt_6iproto_8protocol_8Response_notify(__pyx_v_self);

  /* "asynctnt/iproto/response.pyx":72
 *         self.notify()
 * 
 *     cdef inline void set_exception(self, exc):             # <<<<<<<<<<<<<<
 *         self._exception = exc
 *         self.notify()
 */

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

/* "asynctnt/iproto/response.pyx":76
 *         self.notify()
 * 
 *     cdef inline object get_exception(self):             # <<<<<<<<<<<<<<
 *         return self._exception
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_8asynctnt_6iproto_8protocol_8Response_get_exception(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_exception", 0);

  /* "asynctnt/iproto/response.pyx":77
 * 
 *     cdef inline object get_exception(self):
 *         return self._exception             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void notify(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_exception);
  __pyx_r = __pyx_v_self->_exception;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":76
 *         self.notify()
 * 
 *     cdef inline object get_exception(self):             # <<<<<<<<<<<<<<
 *         return self._exception
 * 
 */

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

/* "asynctnt/iproto/response.pyx":79
 *         return self._exception
 * 
 *     cdef inline void notify(self):             # <<<<<<<<<<<<<<
 *         if self._push_subscribe:
 *             self._push_event_set()  # Notify that there is no more data
 */

static CYTHON_INLINE void __pyx_f_8asynctnt_6iproto_8protocol_8Response_notify(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("notify", 0);

  /* "asynctnt/iproto/response.pyx":80
 * 
 *     cdef inline void notify(self):
 *         if self._push_subscribe:             # <<<<<<<<<<<<<<
 *             self._push_event_set()  # Notify that there is no more data
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_push_subscribe != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/response.pyx":81
 *     cdef inline void notify(self):
 *         if self._push_subscribe:
 *             self._push_event_set()  # Notify that there is no more data             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):  # pragma: nocover
 */
    __Pyx_INCREF(__pyx_v_self->_push_event_set);
    __pyx_t_3 = __pyx_v_self->_push_event_set; __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __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;

    /* "asynctnt/iproto/response.pyx":80
 * 
 *     cdef inline void notify(self):
 *         if self._push_subscribe:             # <<<<<<<<<<<<<<
 *             self._push_event_set()  # Notify that there is no more data
 * 
 */
  }

  /* "asynctnt/iproto/response.pyx":79
 *         return self._exception
 * 
 *     cdef inline void notify(self):             # <<<<<<<<<<<<<<
 *         if self._push_subscribe:
 *             self._push_event_set()  # Notify that there is no more data
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.Response.notify", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/response.pyx":83
 *             self._push_event_set()  # Notify that there is no more data
 * 
 *     def __repr__(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         data = self._body
 *         if data is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_2__repr__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

/* "asynctnt/iproto/response.pyx":87
 *         if data is not None:
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [             # <<<<<<<<<<<<<<
 *                     data[:5],
 *                     data[-2:]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8__repr___lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_8Response_8__repr___lambda1 = {"lambda1", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8__repr___lambda1, METH_O, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8__repr___lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetBuiltinName(__pyx_n_s_repr); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_x);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__repr__.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":83
 *             self._push_event_set()  # Notify that there is no more data
 * 
 *     def __repr__(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         data = self._body
 *         if data is not None:
 */

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_2__repr__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_parts = 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "asynctnt/iproto/response.pyx":84
 * 
 *     def __repr__(self):  # pragma: nocover
 *         data = self._body             # <<<<<<<<<<<<<<
 *         if data is not None:
 *             if len(data) > 10:
 */
  __pyx_t_1 = __pyx_v_self->_body;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/response.pyx":85
 *     def __repr__(self):  # pragma: nocover
 *         data = self._body
 *         if data is not None:             # <<<<<<<<<<<<<<
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 */
  __pyx_t_2 = (__pyx_v_data != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "asynctnt/iproto/response.pyx":86
 *         data = self._body
 *         if data is not None:
 *             if len(data) > 10:             # <<<<<<<<<<<<<<
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 *                     data[:5],
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(3, 86, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_4 > 10) != 0);
    if (__pyx_t_3) {

      /* "asynctnt/iproto/response.pyx":87
 *         if data is not None:
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [             # <<<<<<<<<<<<<<
 *                     data[:5],
 *                     data[-2:]
 */
      __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8asynctnt_6iproto_8protocol_8Response_8__repr___lambda1, 0, __pyx_n_s_repr___locals_lambda, NULL, __pyx_n_s_asynctnt_iproto_protocol, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "asynctnt/iproto/response.pyx":88
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 *                     data[:5],             # <<<<<<<<<<<<<<
 *                     data[-2:]
 *                 ])
 */
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 5, NULL, NULL, &__pyx_slice__30, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "asynctnt/iproto/response.pyx":89
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 *                     data[:5],
 *                     data[-2:]             # <<<<<<<<<<<<<<
 *                 ])
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_data, -2L, 0, NULL, NULL, &__pyx_slice__31, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "asynctnt/iproto/response.pyx":87
 *         if data is not None:
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [             # <<<<<<<<<<<<<<
 *                     data[:5],
 *                     data[-2:]
 */
      __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __pyx_t_1 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_parts = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/response.pyx":92
 *                 ])
 * 
 *                 data = ' ... '.join(parts)             # <<<<<<<<<<<<<<
 *                 data = '[' + data + ']'
 * 
 */
      __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__32, __pyx_v_parts); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/response.pyx":93
 * 
 *                 data = ' ... '.join(parts)
 *                 data = '[' + data + ']'             # <<<<<<<<<<<<<<
 * 
 *         return '<{} sync={} rowcount={} data={}>'.format(
 */
      __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u__33, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u__34); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "asynctnt/iproto/response.pyx":86
 *         data = self._body
 *         if data is not None:
 *             if len(data) > 10:             # <<<<<<<<<<<<<<
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 *                     data[:5],
 */
    }

    /* "asynctnt/iproto/response.pyx":85
 *     def __repr__(self):  # pragma: nocover
 *         data = self._body
 *         if data is not None:             # <<<<<<<<<<<<<<
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 */
  }

  /* "asynctnt/iproto/response.pyx":95
 *                 data = '[' + data + ']'
 * 
 *         return '<{} sync={} rowcount={} data={}>'.format(             # <<<<<<<<<<<<<<
 *             self.__class__.__name__, self.sync, self.rowcount, data)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_sync_rowcount_data, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "asynctnt/iproto/response.pyx":96
 * 
 *         return '<{} sync={} rowcount={} data={}>'.format(
 *             self.__class__.__name__, self.sync, self.rowcount, data)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rowcount); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_5, __pyx_t_1, __pyx_t_8, __pyx_v_data};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 95, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_5, __pyx_t_1, __pyx_t_8, __pyx_v_data};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 95, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_v_data);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_8 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":83
 *             self._push_event_set()  # Notify that there is no more data
 * 
 *     def __repr__(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         data = self._body
 *         if data is not None:
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_parts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":99
 * 
 *     @property
 *     def sync(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Response's sync (incremental id) for the corresponding request
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_4sync_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_4sync_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_4sync___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/response.pyx":103
 *             Response's sync (incremental id) for the corresponding request
 *         """
 *         return self._sync             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":99
 * 
 *     @property
 *     def sync(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Response's sync (incremental id) for the corresponding request
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.sync.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":106
 * 
 *     @property
 *     def code(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Response code (0 - success)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_4code_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_4code_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_4code___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/response.pyx":110
 *             Response code (0 - success)
 *         """
 *         return self._code             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":106
 * 
 *     @property
 *     def code(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Response code (0 - success)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.code.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":113
 * 
 *     @property
 *     def return_code(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Response return code (It's essentially a code & 0x7FFF)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_11return_code_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_11return_code_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_11return_code___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/response.pyx":117
 *             Response return code (It's essentially a code & 0x7FFF)
 *         """
 *         return self._return_code             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_return_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":113
 * 
 *     @property
 *     def return_code(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Response return code (It's essentially a code & 0x7FFF)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.return_code.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":120
 * 
 *     @property
 *     def schema_id(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Current scema id in Tarantool
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_9schema_id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_9schema_id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_9schema_id___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/response.pyx":124
 *             Current scema id in Tarantool
 *         """
 *         return self._schema_id             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_schema_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":120
 * 
 *     @property
 *     def schema_id(self) -> int:             # <<<<<<<<<<<<<<
 *         """
 *             Current scema id in Tarantool
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.schema_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":127
 * 
 *     @property
 *     def errmsg(self) -> Optional[str]:             # <<<<<<<<<<<<<<
 *         """
 *             If self.code != 0 then errmsg contains an error message
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_6errmsg_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_6errmsg_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_6errmsg___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_6errmsg___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/response.pyx":131
 *             If self.code != 0 then errmsg contains an error message
 *         """
 *         return self._errmsg             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_errmsg);
  __pyx_r = __pyx_v_self->_errmsg;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":127
 * 
 *     @property
 *     def errmsg(self) -> Optional[str]:             # <<<<<<<<<<<<<<
 *         """
 *             If self.code != 0 then errmsg contains an error message
 */

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

/* "asynctnt/iproto/response.pyx":134
 * 
 *     @property
 *     def body(self) -> Optional[list]:             # <<<<<<<<<<<<<<
 *         """
 *             Response body
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_4body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_4body_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_4body___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_4body___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/response.pyx":138
 *             Response body
 *         """
 *         return self._body             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_body);
  __pyx_r = __pyx_v_self->_body;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":134
 * 
 *     @property
 *     def body(self) -> Optional[list]:             # <<<<<<<<<<<<<<
 *         """
 *             Response body
 */

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

/* "asynctnt/iproto/response.pyx":141
 * 
 *     @property
 *     def encoding(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *             Response encoding
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8encoding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8encoding_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_8encoding___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_8encoding___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/response.pyx":145
 *             Response encoding
 *         """
 *         return self._encoding             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_encoding);
  __pyx_r = __pyx_v_self->_encoding;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":141
 * 
 *     @property
 *     def encoding(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *             Response encoding
 */

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

/* "asynctnt/iproto/response.pyx":148
 * 
 *     @property
 *     def rowcount(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._body is not None:
 *             self_len = self._len()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_8rowcount_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_8rowcount___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_8rowcount___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  uint32_t __pyx_v_self_len;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/response.pyx":149
 *     @property
 *     def rowcount(self) -> int:
 *         if self._body is not None:             # <<<<<<<<<<<<<<
 *             self_len = self._len()
 *             if self_len > 0:
 */
  __pyx_t_1 = (__pyx_v_self->_body != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/response.pyx":150
 *     def rowcount(self) -> int:
 *         if self._body is not None:
 *             self_len = self._len()             # <<<<<<<<<<<<<<
 *             if self_len > 0:
 *                 return self_len
 */
    __pyx_v_self_len = __pyx_f_8asynctnt_6iproto_8protocol_8Response__len(__pyx_v_self);

    /* "asynctnt/iproto/response.pyx":151
 *         if self._body is not None:
 *             self_len = self._len()
 *             if self_len > 0:             # <<<<<<<<<<<<<<
 *                 return self_len
 *         return self._rowcount
 */
    __pyx_t_2 = ((__pyx_v_self_len > 0) != 0);
    if (__pyx_t_2) {

      /* "asynctnt/iproto/response.pyx":152
 *             self_len = self._len()
 *             if self_len > 0:
 *                 return self_len             # <<<<<<<<<<<<<<
 *         return self._rowcount
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_self_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "asynctnt/iproto/response.pyx":151
 *         if self._body is not None:
 *             self_len = self._len()
 *             if self_len > 0:             # <<<<<<<<<<<<<<
 *                 return self_len
 *         return self._rowcount
 */
    }

    /* "asynctnt/iproto/response.pyx":149
 *     @property
 *     def rowcount(self) -> int:
 *         if self._body is not None:             # <<<<<<<<<<<<<<
 *             self_len = self._len()
 *             if self_len > 0:
 */
  }

  /* "asynctnt/iproto/response.pyx":153
 *             if self_len > 0:
 *                 return self_len
 *         return self._rowcount             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_rowcount); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":148
 * 
 *     @property
 *     def rowcount(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._body is not None:
 *             self_len = self._len()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.rowcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":156
 * 
 *     @property
 *     def autoincrement_ids(self) -> Optional[list]:             # <<<<<<<<<<<<<<
 *         """
 *             Response autoincrement ids
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_17autoincrement_ids_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_17autoincrement_ids_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_17autoincrement_ids___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_17autoincrement_ids___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/response.pyx":160
 *             Response autoincrement ids
 *         """
 *         return self._autoincrement_ids             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_autoincrement_ids);
  __pyx_r = __pyx_v_self->_autoincrement_ids;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":156
 * 
 *     @property
 *     def autoincrement_ids(self) -> Optional[list]:             # <<<<<<<<<<<<<<
 *         """
 *             Response autoincrement ids
 */

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

/* "asynctnt/iproto/response.pyx":163
 * 
 * 
 *     def done(self):             # <<<<<<<<<<<<<<
 *         return self._code >= 0
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_5done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_5done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_4done(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/response.pyx":164
 * 
 *     def done(self):
 *         return self._code >= 0             # <<<<<<<<<<<<<<
 * 
 *     cdef inline uint32_t _len(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->_code >= 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":163
 * 
 * 
 *     def done(self):             # <<<<<<<<<<<<<<
 *         return self._code >= 0
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":166
 *         return self._code >= 0
 * 
 *     cdef inline uint32_t _len(self):             # <<<<<<<<<<<<<<
 *         return <uint32_t>cpython.list.PyList_GET_SIZE(self._body)
 * 
 */

static CYTHON_INLINE uint32_t __pyx_f_8asynctnt_6iproto_8protocol_8Response__len(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_len", 0);

  /* "asynctnt/iproto/response.pyx":167
 * 
 *     cdef inline uint32_t _len(self):
 *         return <uint32_t>cpython.list.PyList_GET_SIZE(self._body)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self) -> int:
 */
  __pyx_t_1 = __pyx_v_self->_body;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_r = ((uint32_t)PyList_GET_SIZE(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":166
 *         return self._code >= 0
 * 
 *     cdef inline uint32_t _len(self):             # <<<<<<<<<<<<<<
 *         return <uint32_t>cpython.list.PyList_GET_SIZE(self._body)
 * 
 */

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

/* "asynctnt/iproto/response.pyx":169
 *         return <uint32_t>cpython.list.PyList_GET_SIZE(self._body)
 * 
 *     def __len__(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._body is not None:
 *             return <int>self._len()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_8asynctnt_6iproto_8protocol_8Response_7__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_8asynctnt_6iproto_8protocol_8Response_7__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_6__len__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_8asynctnt_6iproto_8protocol_8Response_6__len__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "asynctnt/iproto/response.pyx":170
 * 
 *     def __len__(self) -> int:
 *         if self._body is not None:             # <<<<<<<<<<<<<<
 *             return <int>self._len()
 *         return 0
 */
  __pyx_t_1 = (__pyx_v_self->_body != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/response.pyx":171
 *     def __len__(self) -> int:
 *         if self._body is not None:
 *             return <int>self._len()             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __pyx_r = ((int)__pyx_f_8asynctnt_6iproto_8protocol_8Response__len(__pyx_v_self));
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":170
 * 
 *     def __len__(self) -> int:
 *         if self._body is not None:             # <<<<<<<<<<<<<<
 *             return <int>self._len()
 *         return 0
 */
  }

  /* "asynctnt/iproto/response.pyx":172
 *         if self._body is not None:
 *             return <int>self._len()
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":169
 *         return <uint32_t>cpython.list.PyList_GET_SIZE(self._body)
 * 
 *     def __len__(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._body is not None:
 *             return <int>self._len()
 */

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

/* "asynctnt/iproto/response.pyx":174
 *         return 0
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self._body[i]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_8__getitem__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_8__getitem__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "asynctnt/iproto/response.pyx":175
 * 
 *     def __getitem__(self, i):
 *         return self._body[i]             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->_body == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(3, 175, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_body, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":174
 *         return 0
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self._body[i]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":177
 *         return self._body[i]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter(self._body)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_11__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_11__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_10__iter__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_10__iter__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "asynctnt/iproto/response.pyx":178
 * 
 *     def __iter__(self):
 *         return iter(self._body)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_body;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":177
 *         return self._body[i]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter(self._body)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pxd":25
 *         object _exception
 * 
 *         readonly object _q             # <<<<<<<<<<<<<<
 *         readonly object _push_event
 *         object _q_append
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_2_q_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_2_q_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_2_q___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_2_q___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_q);
  __pyx_r = __pyx_v_self->_q;
  goto __pyx_L0;

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

/* "asynctnt/iproto/response.pxd":26
 * 
 *         readonly object _q
 *         readonly object _push_event             # <<<<<<<<<<<<<<
 *         object _q_append
 *         object _q_popleft
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_11_push_event_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_11_push_event_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_11_push_event___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_11_push_event___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_push_event);
  __pyx_r = __pyx_v_self->_push_event;
  goto __pyx_L0;

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_12__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_8Response_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_8Response_14__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_8Response_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Response.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":181
 * 
 * 
 * cdef object _decode_obj(const char **p, bytes encoding):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t i
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol__decode_obj(char const **__pyx_v_p, PyObject *__pyx_v_encoding) {
  uint32_t __pyx_v_i;
  enum mp_type __pyx_v_obj_type;
  char const *__pyx_v_s;
  uint32_t __pyx_v_s_len;
  uint32_t __pyx_v_arr_size;
  uint32_t __pyx_v_map_size;
  PyObject *__pyx_v_map = 0;
  enum mp_type __pyx_v_map_key_type;
  char const *__pyx_v_map_key_str;
  uint32_t __pyx_v_map_key_len;
  PyObject *__pyx_v_map_key = 0;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_el = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  uint32_t __pyx_t_9;
  uint32_t __pyx_t_10;
  uint32_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_obj", 0);

  /* "asynctnt/iproto/response.pyx":199
 *         object map_key
 * 
 *     obj_type = mp_typeof(p[0][0])             # <<<<<<<<<<<<<<
 *     if obj_type == MP_UINT:
 *         return mp_decode_uint(p)
 */
  __pyx_v_obj_type = mp_typeof(((__pyx_v_p[0])[0]));

  /* "asynctnt/iproto/response.pyx":200
 * 
 *     obj_type = mp_typeof(p[0][0])
 *     if obj_type == MP_UINT:             # <<<<<<<<<<<<<<
 *         return mp_decode_uint(p)
 *     elif obj_type == MP_INT:
 */
  switch (__pyx_v_obj_type) {
    case MP_UINT:

    /* "asynctnt/iproto/response.pyx":201
 *     obj_type = mp_typeof(p[0][0])
 *     if obj_type == MP_UINT:
 *         return mp_decode_uint(p)             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_INT:
 *         return mp_decode_int(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_uint64_t(mp_decode_uint(__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":200
 * 
 *     obj_type = mp_typeof(p[0][0])
 *     if obj_type == MP_UINT:             # <<<<<<<<<<<<<<
 *         return mp_decode_uint(p)
 *     elif obj_type == MP_INT:
 */
    break;
    case MP_INT:

    /* "asynctnt/iproto/response.pyx":203
 *         return mp_decode_uint(p)
 *     elif obj_type == MP_INT:
 *         return mp_decode_int(p)             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_STR:
 *         s = NULL
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int64_t(mp_decode_int(__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":202
 *     if obj_type == MP_UINT:
 *         return mp_decode_uint(p)
 *     elif obj_type == MP_INT:             # <<<<<<<<<<<<<<
 *         return mp_decode_int(p)
 *     elif obj_type == MP_STR:
 */
    break;
    case MP_STR:

    /* "asynctnt/iproto/response.pyx":205
 *         return mp_decode_int(p)
 *     elif obj_type == MP_STR:
 *         s = NULL             # <<<<<<<<<<<<<<
 *         s_len = 0
 *         s = mp_decode_str(p, &s_len)
 */
    __pyx_v_s = NULL;

    /* "asynctnt/iproto/response.pyx":206
 *     elif obj_type == MP_STR:
 *         s = NULL
 *         s_len = 0             # <<<<<<<<<<<<<<
 *         s = mp_decode_str(p, &s_len)
 *         try:
 */
    __pyx_v_s_len = 0;

    /* "asynctnt/iproto/response.pyx":207
 *         s = NULL
 *         s_len = 0
 *         s = mp_decode_str(p, &s_len)             # <<<<<<<<<<<<<<
 *         try:
 *             return decode_string(s[:s_len], encoding)
 */
    __pyx_v_s = mp_decode_str(__pyx_v_p, (&__pyx_v_s_len));

    /* "asynctnt/iproto/response.pyx":208
 *         s_len = 0
 *         s = mp_decode_str(p, &s_len)
 *         try:             # <<<<<<<<<<<<<<
 *             return decode_string(s[:s_len], encoding)
 *         except UnicodeDecodeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "asynctnt/iproto/response.pyx":209
 *         s = mp_decode_str(p, &s_len)
 *         try:
 *             return decode_string(s[:s_len], encoding)             # <<<<<<<<<<<<<<
 *         except UnicodeDecodeError:
 *             return <bytes>s[:s_len]
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_s_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 209, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __pyx_f_8asynctnt_6iproto_8protocol_decode_string(((PyObject*)__pyx_t_1), __pyx_v_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 209, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L7_try_return;

        /* "asynctnt/iproto/response.pyx":208
 *         s_len = 0
 *         s = mp_decode_str(p, &s_len)
 *         try:             # <<<<<<<<<<<<<<
 *             return decode_string(s[:s_len], encoding)
 *         except UnicodeDecodeError:
 */
      }
      __pyx_L3_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asynctnt/iproto/response.pyx":210
 *         try:
 *             return decode_string(s[:s_len], encoding)
 *         except UnicodeDecodeError:             # <<<<<<<<<<<<<<
 *             return <bytes>s[:s_len]
 *     elif obj_type == MP_BIN:
 */
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
      if (__pyx_t_6) {
        __Pyx_AddTraceback("asynctnt.iproto.protocol._decode_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(3, 210, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_7);

        /* "asynctnt/iproto/response.pyx":211
 *             return decode_string(s[:s_len], encoding)
 *         except UnicodeDecodeError:
 *             return <bytes>s[:s_len]             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_BIN:
 *         s = NULL
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_s_len - 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 211, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(((PyObject*)__pyx_t_8));
        __pyx_r = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L6_except_return;
      }
      goto __pyx_L5_except_error;
      __pyx_L5_except_error:;

      /* "asynctnt/iproto/response.pyx":208
 *         s_len = 0
 *         s = mp_decode_str(p, &s_len)
 *         try:             # <<<<<<<<<<<<<<
 *             return decode_string(s[:s_len], encoding)
 *         except UnicodeDecodeError:
 */
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L7_try_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
      __pyx_L6_except_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
    }

    /* "asynctnt/iproto/response.pyx":204
 *     elif obj_type == MP_INT:
 *         return mp_decode_int(p)
 *     elif obj_type == MP_STR:             # <<<<<<<<<<<<<<
 *         s = NULL
 *         s_len = 0
 */
    break;
    case MP_BIN:

    /* "asynctnt/iproto/response.pyx":213
 *             return <bytes>s[:s_len]
 *     elif obj_type == MP_BIN:
 *         s = NULL             # <<<<<<<<<<<<<<
 *         s_len = 0
 *         s = mp_decode_bin(p, &s_len)
 */
    __pyx_v_s = NULL;

    /* "asynctnt/iproto/response.pyx":214
 *     elif obj_type == MP_BIN:
 *         s = NULL
 *         s_len = 0             # <<<<<<<<<<<<<<
 *         s = mp_decode_bin(p, &s_len)
 *         return <bytes>s[:s_len]
 */
    __pyx_v_s_len = 0;

    /* "asynctnt/iproto/response.pyx":215
 *         s = NULL
 *         s_len = 0
 *         s = mp_decode_bin(p, &s_len)             # <<<<<<<<<<<<<<
 *         return <bytes>s[:s_len]
 *     elif obj_type == MP_BOOL:
 */
    __pyx_v_s = mp_decode_bin(__pyx_v_p, (&__pyx_v_s_len));

    /* "asynctnt/iproto/response.pyx":216
 *         s_len = 0
 *         s = mp_decode_bin(p, &s_len)
 *         return <bytes>s[:s_len]             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_BOOL:
 *         return mp_decode_bool(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_s_len - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject*)__pyx_t_7));
    __pyx_r = __pyx_t_7;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":212
 *         except UnicodeDecodeError:
 *             return <bytes>s[:s_len]
 *     elif obj_type == MP_BIN:             # <<<<<<<<<<<<<<
 *         s = NULL
 *         s_len = 0
 */
    break;
    case MP_BOOL:

    /* "asynctnt/iproto/response.pyx":218
 *         return <bytes>s[:s_len]
 *     elif obj_type == MP_BOOL:
 *         return mp_decode_bool(p)             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_FLOAT:
 *         return mp_decode_float(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyBool_FromLong(mp_decode_bool(__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":217
 *         s = mp_decode_bin(p, &s_len)
 *         return <bytes>s[:s_len]
 *     elif obj_type == MP_BOOL:             # <<<<<<<<<<<<<<
 *         return mp_decode_bool(p)
 *     elif obj_type == MP_FLOAT:
 */
    break;
    case MP_FLOAT:

    /* "asynctnt/iproto/response.pyx":220
 *         return mp_decode_bool(p)
 *     elif obj_type == MP_FLOAT:
 *         return mp_decode_float(p)             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_DOUBLE:
 *         return mp_decode_double(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = PyFloat_FromDouble(mp_decode_float(__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":219
 *     elif obj_type == MP_BOOL:
 *         return mp_decode_bool(p)
 *     elif obj_type == MP_FLOAT:             # <<<<<<<<<<<<<<
 *         return mp_decode_float(p)
 *     elif obj_type == MP_DOUBLE:
 */
    break;
    case MP_DOUBLE:

    /* "asynctnt/iproto/response.pyx":222
 *         return mp_decode_float(p)
 *     elif obj_type == MP_DOUBLE:
 *         return mp_decode_double(p)             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_ARRAY:
 *         arr_size = mp_decode_array(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = PyFloat_FromDouble(mp_decode_double(__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":221
 *     elif obj_type == MP_FLOAT:
 *         return mp_decode_float(p)
 *     elif obj_type == MP_DOUBLE:             # <<<<<<<<<<<<<<
 *         return mp_decode_double(p)
 *     elif obj_type == MP_ARRAY:
 */
    break;
    case MP_ARRAY:

    /* "asynctnt/iproto/response.pyx":224
 *         return mp_decode_double(p)
 *     elif obj_type == MP_ARRAY:
 *         arr_size = mp_decode_array(p)             # <<<<<<<<<<<<<<
 *         value = cpython.list.PyList_New(arr_size)
 *         for i in range(arr_size):
 */
    __pyx_v_arr_size = mp_decode_array(__pyx_v_p);

    /* "asynctnt/iproto/response.pyx":225
 *     elif obj_type == MP_ARRAY:
 *         arr_size = mp_decode_array(p)
 *         value = cpython.list.PyList_New(arr_size)             # <<<<<<<<<<<<<<
 *         for i in range(arr_size):
 *             el = _decode_obj(p, encoding)
 */
    __pyx_t_7 = PyList_New(__pyx_v_arr_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_value = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "asynctnt/iproto/response.pyx":226
 *         arr_size = mp_decode_array(p)
 *         value = cpython.list.PyList_New(arr_size)
 *         for i in range(arr_size):             # <<<<<<<<<<<<<<
 *             el = _decode_obj(p, encoding)
 *             cpython.Py_INCREF(el)
 */
    __pyx_t_9 = __pyx_v_arr_size;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "asynctnt/iproto/response.pyx":227
 *         value = cpython.list.PyList_New(arr_size)
 *         for i in range(arr_size):
 *             el = _decode_obj(p, encoding)             # <<<<<<<<<<<<<<
 *             cpython.Py_INCREF(el)
 *             cpython.list.PyList_SET_ITEM(value, i, el)
 */
      __pyx_t_7 = __pyx_f_8asynctnt_6iproto_8protocol__decode_obj(__pyx_v_p, __pyx_v_encoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/response.pyx":228
 *         for i in range(arr_size):
 *             el = _decode_obj(p, encoding)
 *             cpython.Py_INCREF(el)             # <<<<<<<<<<<<<<
 *             cpython.list.PyList_SET_ITEM(value, i, el)
 *         return value
 */
      Py_INCREF(__pyx_v_el);

      /* "asynctnt/iproto/response.pyx":229
 *             el = _decode_obj(p, encoding)
 *             cpython.Py_INCREF(el)
 *             cpython.list.PyList_SET_ITEM(value, i, el)             # <<<<<<<<<<<<<<
 *         return value
 *     elif obj_type == MP_MAP:
 */
      PyList_SET_ITEM(__pyx_v_value, __pyx_v_i, __pyx_v_el);
    }

    /* "asynctnt/iproto/response.pyx":230
 *             cpython.Py_INCREF(el)
 *             cpython.list.PyList_SET_ITEM(value, i, el)
 *         return value             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_MAP:
 *         map = {}
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":223
 *     elif obj_type == MP_DOUBLE:
 *         return mp_decode_double(p)
 *     elif obj_type == MP_ARRAY:             # <<<<<<<<<<<<<<
 *         arr_size = mp_decode_array(p)
 *         value = cpython.list.PyList_New(arr_size)
 */
    break;
    case MP_MAP:

    /* "asynctnt/iproto/response.pyx":232
 *         return value
 *     elif obj_type == MP_MAP:
 *         map = {}             # <<<<<<<<<<<<<<
 *         map_size = mp_decode_map(p)
 *         for i in range(map_size):
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_map = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "asynctnt/iproto/response.pyx":233
 *     elif obj_type == MP_MAP:
 *         map = {}
 *         map_size = mp_decode_map(p)             # <<<<<<<<<<<<<<
 *         for i in range(map_size):
 *             map_key_type = mp_typeof(p[0][0])
 */
    __pyx_v_map_size = mp_decode_map(__pyx_v_p);

    /* "asynctnt/iproto/response.pyx":234
 *         map = {}
 *         map_size = mp_decode_map(p)
 *         for i in range(map_size):             # <<<<<<<<<<<<<<
 *             map_key_type = mp_typeof(p[0][0])
 *             if map_key_type == MP_STR:
 */
    __pyx_t_9 = __pyx_v_map_size;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "asynctnt/iproto/response.pyx":235
 *         map_size = mp_decode_map(p)
 *         for i in range(map_size):
 *             map_key_type = mp_typeof(p[0][0])             # <<<<<<<<<<<<<<
 *             if map_key_type == MP_STR:
 *                 map_key_len = 0
 */
      __pyx_v_map_key_type = mp_typeof(((__pyx_v_p[0])[0]));

      /* "asynctnt/iproto/response.pyx":236
 *         for i in range(map_size):
 *             map_key_type = mp_typeof(p[0][0])
 *             if map_key_type == MP_STR:             # <<<<<<<<<<<<<<
 *                 map_key_len = 0
 *                 map_key_str = mp_decode_str(p, &map_key_len)
 */
      switch (__pyx_v_map_key_type) {
        case MP_STR:

        /* "asynctnt/iproto/response.pyx":237
 *             map_key_type = mp_typeof(p[0][0])
 *             if map_key_type == MP_STR:
 *                 map_key_len = 0             # <<<<<<<<<<<<<<
 *                 map_key_str = mp_decode_str(p, &map_key_len)
 *                 map_key = <object>(
 */
        __pyx_v_map_key_len = 0;

        /* "asynctnt/iproto/response.pyx":238
 *             if map_key_type == MP_STR:
 *                 map_key_len = 0
 *                 map_key_str = mp_decode_str(p, &map_key_len)             # <<<<<<<<<<<<<<
 *                 map_key = <object>(
 *                     decode_string(map_key_str[:map_key_len], encoding)
 */
        __pyx_v_map_key_str = mp_decode_str(__pyx_v_p, (&__pyx_v_map_key_len));

        /* "asynctnt/iproto/response.pyx":240
 *                 map_key_str = mp_decode_str(p, &map_key_len)
 *                 map_key = <object>(
 *                     decode_string(map_key_str[:map_key_len], encoding)             # <<<<<<<<<<<<<<
 *                 )
 *             elif map_key_type == MP_UINT:
 */
        __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_map_key_str + 0, __pyx_v_map_key_len - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_decode_string(((PyObject*)__pyx_t_7), __pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asynctnt/iproto/response.pyx":239
 *                 map_key_len = 0
 *                 map_key_str = mp_decode_str(p, &map_key_len)
 *                 map_key = <object>(             # <<<<<<<<<<<<<<
 *                     decode_string(map_key_str[:map_key_len], encoding)
 *                 )
 */
        __pyx_t_7 = __pyx_t_1;
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_map_key, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "asynctnt/iproto/response.pyx":236
 *         for i in range(map_size):
 *             map_key_type = mp_typeof(p[0][0])
 *             if map_key_type == MP_STR:             # <<<<<<<<<<<<<<
 *                 map_key_len = 0
 *                 map_key_str = mp_decode_str(p, &map_key_len)
 */
        break;
        case MP_UINT:

        /* "asynctnt/iproto/response.pyx":243
 *                 )
 *             elif map_key_type == MP_UINT:
 *                 map_key = <object>mp_decode_uint(p)             # <<<<<<<<<<<<<<
 *             elif map_key_type == MP_INT:
 *                 map_key = <object>mp_decode_int(p)
 */
        __pyx_t_7 = __Pyx_PyInt_From_uint64_t(mp_decode_uint(__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = __pyx_t_7;
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_map_key, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "asynctnt/iproto/response.pyx":242
 *                     decode_string(map_key_str[:map_key_len], encoding)
 *                 )
 *             elif map_key_type == MP_UINT:             # <<<<<<<<<<<<<<
 *                 map_key = <object>mp_decode_uint(p)
 *             elif map_key_type == MP_INT:
 */
        break;
        case MP_INT:

        /* "asynctnt/iproto/response.pyx":245
 *                 map_key = <object>mp_decode_uint(p)
 *             elif map_key_type == MP_INT:
 *                 map_key = <object>mp_decode_int(p)             # <<<<<<<<<<<<<<
 *             elif map_key_type == MP_FLOAT:
 *                 map_key = <object>mp_decode_float(p)
 */
        __pyx_t_1 = __Pyx_PyInt_From_int64_t(mp_decode_int(__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = __pyx_t_1;
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_map_key, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "asynctnt/iproto/response.pyx":244
 *             elif map_key_type == MP_UINT:
 *                 map_key = <object>mp_decode_uint(p)
 *             elif map_key_type == MP_INT:             # <<<<<<<<<<<<<<
 *                 map_key = <object>mp_decode_int(p)
 *             elif map_key_type == MP_FLOAT:
 */
        break;
        case MP_FLOAT:

        /* "asynctnt/iproto/response.pyx":247
 *                 map_key = <object>mp_decode_int(p)
 *             elif map_key_type == MP_FLOAT:
 *                 map_key = <object>mp_decode_float(p)             # <<<<<<<<<<<<<<
 *             elif map_key_type == MP_DOUBLE:
 *                 map_key = <object>mp_decode_double(p)
 */
        __pyx_t_7 = PyFloat_FromDouble(mp_decode_float(__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 247, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = __pyx_t_7;
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_map_key, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "asynctnt/iproto/response.pyx":246
 *             elif map_key_type == MP_INT:
 *                 map_key = <object>mp_decode_int(p)
 *             elif map_key_type == MP_FLOAT:             # <<<<<<<<<<<<<<
 *                 map_key = <object>mp_decode_float(p)
 *             elif map_key_type == MP_DOUBLE:
 */
        break;
        case MP_DOUBLE:

        /* "asynctnt/iproto/response.pyx":249
 *                 map_key = <object>mp_decode_float(p)
 *             elif map_key_type == MP_DOUBLE:
 *                 map_key = <object>mp_decode_double(p)             # <<<<<<<<<<<<<<
 *             else:  # pragma: nocover
 *                 mp_next(p)  # skip current key
 */
        __pyx_t_1 = PyFloat_FromDouble(mp_decode_double(__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = __pyx_t_1;
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_map_key, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "asynctnt/iproto/response.pyx":248
 *             elif map_key_type == MP_FLOAT:
 *                 map_key = <object>mp_decode_float(p)
 *             elif map_key_type == MP_DOUBLE:             # <<<<<<<<<<<<<<
 *                 map_key = <object>mp_decode_double(p)
 *             else:  # pragma: nocover
 */
        break;
        default:

        /* "asynctnt/iproto/response.pyx":251
 *                 map_key = <object>mp_decode_double(p)
 *             else:  # pragma: nocover
 *                 mp_next(p)  # skip current key             # <<<<<<<<<<<<<<
 *                 mp_next(p)  # skip value
 *                 logger.warning('Unexpected key type in map: %s',
 */
        mp_next(__pyx_v_p);

        /* "asynctnt/iproto/response.pyx":252
 *             else:  # pragma: nocover
 *                 mp_next(p)  # skip current key
 *                 mp_next(p)  # skip value             # <<<<<<<<<<<<<<
 *                 logger.warning('Unexpected key type in map: %s',
 *                                map_key_type)
 */
        mp_next(__pyx_v_p);

        /* "asynctnt/iproto/response.pyx":253
 *                 mp_next(p)  # skip current key
 *                 mp_next(p)  # skip value
 *                 logger.warning('Unexpected key type in map: %s',             # <<<<<<<<<<<<<<
 *                                map_key_type)
 *                 continue
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asynctnt/iproto/response.pyx":254
 *                 mp_next(p)  # skip value
 *                 logger.warning('Unexpected key type in map: %s',
 *                                map_key_type)             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
        __pyx_t_1 = __Pyx_PyInt_From_enum__mp_type(__pyx_v_map_key_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 254, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && 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_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Unexpected_key_type_in_map_s, __pyx_t_1};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 253, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Unexpected_key_type_in_map_s, __pyx_t_1};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 253, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 253, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_8) {
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL;
          }
          __Pyx_INCREF(__pyx_kp_u_Unexpected_key_type_in_map_s);
          __Pyx_GIVEREF(__pyx_kp_u_Unexpected_key_type_in_map_s);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_kp_u_Unexpected_key_type_in_map_s);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 253, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asynctnt/iproto/response.pyx":255
 *                 logger.warning('Unexpected key type in map: %s',
 *                                map_key_type)
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             map[map_key] = _decode_obj(p, encoding)
 */
        goto __pyx_L13_continue;
        break;
      }

      /* "asynctnt/iproto/response.pyx":257
 *                 continue
 * 
 *             map[map_key] = _decode_obj(p, encoding)             # <<<<<<<<<<<<<<
 * 
 *         return map
 */
      __pyx_t_7 = __pyx_f_8asynctnt_6iproto_8protocol__decode_obj(__pyx_v_p, __pyx_v_encoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(PyDict_SetItem(__pyx_v_map, __pyx_v_map_key, __pyx_t_7) < 0)) __PYX_ERR(3, 257, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_L13_continue:;
    }

    /* "asynctnt/iproto/response.pyx":259
 *             map[map_key] = _decode_obj(p, encoding)
 * 
 *         return map             # <<<<<<<<<<<<<<
 *     elif obj_type == MP_NIL:
 *         mp_next(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_map);
    __pyx_r = __pyx_v_map;
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":231
 *             cpython.list.PyList_SET_ITEM(value, i, el)
 *         return value
 *     elif obj_type == MP_MAP:             # <<<<<<<<<<<<<<
 *         map = {}
 *         map_size = mp_decode_map(p)
 */
    break;
    case MP_NIL:

    /* "asynctnt/iproto/response.pyx":261
 *         return map
 *     elif obj_type == MP_NIL:
 *         mp_next(p)             # <<<<<<<<<<<<<<
 *         return None
 *     else:  # pragma: nocover
 */
    mp_next(__pyx_v_p);

    /* "asynctnt/iproto/response.pyx":262
 *     elif obj_type == MP_NIL:
 *         mp_next(p)
 *         return None             # <<<<<<<<<<<<<<
 *     else:  # pragma: nocover
 *         mp_next(p)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asynctnt/iproto/response.pyx":260
 * 
 *         return map
 *     elif obj_type == MP_NIL:             # <<<<<<<<<<<<<<
 *         mp_next(p)
 *         return None
 */
    break;
    default:

    /* "asynctnt/iproto/response.pyx":264
 *         return None
 *     else:  # pragma: nocover
 *         mp_next(p)             # <<<<<<<<<<<<<<
 *         logger.warning('Unexpected obj type: %s', obj_type)
 *         return None
 */
    mp_next(__pyx_v_p);

    /* "asynctnt/iproto/response.pyx":265
 *     else:  # pragma: nocover
 *         mp_next(p)
 *         logger.warning('Unexpected obj type: %s', obj_type)             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warning); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_enum__mp_type(__pyx_v_obj_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Unexpected_obj_type_s, __pyx_t_5};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_Unexpected_obj_type_s, __pyx_t_5};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_Unexpected_obj_type_s);
      __Pyx_GIVEREF(__pyx_kp_u_Unexpected_obj_type_s);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_kp_u_Unexpected_obj_type_s);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "asynctnt/iproto/response.pyx":266
 *         mp_next(p)
 *         logger.warning('Unexpected obj type: %s', obj_type)
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    break;
  }

  /* "asynctnt/iproto/response.pyx":181
 * 
 * 
 * cdef object _decode_obj(const char **p, bytes encoding):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asynctnt.iproto.protocol._decode_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_map);
  __Pyx_XDECREF(__pyx_v_map_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_el);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":269
 * 
 * 
 * cdef list _response_parse_body_data(const char **b,             # <<<<<<<<<<<<<<
 *                                     Response resp, Request req):
 *     cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol__response_parse_body_data(char const **__pyx_v_b, struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_resp, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req) {
  uint32_t __pyx_v_size;
  uint32_t __pyx_v_tuple_size;
  PyObject *__pyx_v_tuples = 0;
  uint32_t __pyx_v_i;
  struct C_TntFields *__pyx_v_fields = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  uint32_t __pyx_t_4;
  uint32_t __pyx_t_5;
  uint32_t __pyx_t_6;
  uint32_t __pyx_t_7;
  uint32_t __pyx_t_8;
  uint32_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_RefNannySetupContext("_response_parse_body_data", 0);

  /* "asynctnt/iproto/response.pyx":279
 *         TntFields fields
 * 
 *     size = mp_decode_array(b)             # <<<<<<<<<<<<<<
 *     tuples = []
 * 
 */
  __pyx_v_size = mp_decode_array(__pyx_v_b);

  /* "asynctnt/iproto/response.pyx":280
 * 
 *     size = mp_decode_array(b)
 *     tuples = []             # <<<<<<<<<<<<<<
 * 
 *     if req.parse_as_tuples:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tuples = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/response.pyx":282
 *     tuples = []
 * 
 *     if req.parse_as_tuples:             # <<<<<<<<<<<<<<
 *         # decode as TarantoolTuples
 * 
 */
  __pyx_t_2 = (__pyx_v_req->parse_as_tuples != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/response.pyx":285
 *         # decode as TarantoolTuples
 * 
 *         fields = resp._fields             # <<<<<<<<<<<<<<
 *         if fields is None:
 *             fields = req.fields()
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_resp->_fields);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_fields = ((struct C_TntFields *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/response.pyx":286
 * 
 *         fields = resp._fields
 *         if fields is None:             # <<<<<<<<<<<<<<
 *             fields = req.fields()
 * 
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_fields) == Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "asynctnt/iproto/response.pyx":287
 *         fields = resp._fields
 *         if fields is None:
 *             fields = req.fields()             # <<<<<<<<<<<<<<
 * 
 *         for i in range(size):
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_fields(__pyx_v_req)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_fields, ((struct C_TntFields *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "asynctnt/iproto/response.pyx":286
 * 
 *         fields = resp._fields
 *         if fields is None:             # <<<<<<<<<<<<<<
 *             fields = req.fields()
 * 
 */
    }

    /* "asynctnt/iproto/response.pyx":289
 *             fields = req.fields()
 * 
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0][0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError(
 */
    __pyx_t_4 = __pyx_v_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "asynctnt/iproto/response.pyx":290
 * 
 *         for i in range(size):
 *             if mp_typeof(b[0][0]) != MP_ARRAY:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     'Tuple must be an array when decoding as TarantoolTuple'
 */
      __pyx_t_3 = ((mp_typeof(((__pyx_v_b[0])[0])) != MP_ARRAY) != 0);
      if (unlikely(__pyx_t_3)) {

        /* "asynctnt/iproto/response.pyx":291
 *         for i in range(size):
 *             if mp_typeof(b[0][0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Tuple must be an array when decoding as TarantoolTuple'
 *                 )
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 291, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(3, 291, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":290
 * 
 *         for i in range(size):
 *             if mp_typeof(b[0][0]) != MP_ARRAY:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     'Tuple must be an array when decoding as TarantoolTuple'
 */
      }

      /* "asynctnt/iproto/response.pyx":295
 *                 )
 * 
 *             tuple_size = mp_decode_array(b)             # <<<<<<<<<<<<<<
 *             t = tupleobj.AtntTuple_New(fields, <int>tuple_size)
 *             for i in range(tuple_size):
 */
      __pyx_v_tuple_size = mp_decode_array(__pyx_v_b);

      /* "asynctnt/iproto/response.pyx":296
 * 
 *             tuple_size = mp_decode_array(b)
 *             t = tupleobj.AtntTuple_New(fields, <int>tuple_size)             # <<<<<<<<<<<<<<
 *             for i in range(tuple_size):
 *                 value = _decode_obj(b, resp._encoding)
 */
      __pyx_t_1 = AtntTuple_New(((PyObject *)__pyx_v_fields), ((int)__pyx_v_tuple_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asynctnt/iproto/response.pyx":297
 *             tuple_size = mp_decode_array(b)
 *             t = tupleobj.AtntTuple_New(fields, <int>tuple_size)
 *             for i in range(tuple_size):             # <<<<<<<<<<<<<<
 *                 value = _decode_obj(b, resp._encoding)
 *                 cpython.Py_INCREF(value)
 */
      __pyx_t_7 = __pyx_v_tuple_size;
      __pyx_t_8 = __pyx_t_7;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;

        /* "asynctnt/iproto/response.pyx":298
 *             t = tupleobj.AtntTuple_New(fields, <int>tuple_size)
 *             for i in range(tuple_size):
 *                 value = _decode_obj(b, resp._encoding)             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(value)
 *                 tupleobj.AtntTuple_SET_ITEM(t, i, value)
 */
        __pyx_t_1 = __pyx_v_resp->_encoding;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_10 = __pyx_f_8asynctnt_6iproto_8protocol__decode_obj(__pyx_v_b, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 298, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "asynctnt/iproto/response.pyx":299
 *             for i in range(tuple_size):
 *                 value = _decode_obj(b, resp._encoding)
 *                 cpython.Py_INCREF(value)             # <<<<<<<<<<<<<<
 *                 tupleobj.AtntTuple_SET_ITEM(t, i, value)
 * 
 */
        Py_INCREF(__pyx_v_value);

        /* "asynctnt/iproto/response.pyx":300
 *                 value = _decode_obj(b, resp._encoding)
 *                 cpython.Py_INCREF(value)
 *                 tupleobj.AtntTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 * 
 *             tuples.append(t)
 */
        AtntTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
      }

      /* "asynctnt/iproto/response.pyx":302
 *                 tupleobj.AtntTuple_SET_ITEM(t, i, value)
 * 
 *             tuples.append(t)             # <<<<<<<<<<<<<<
 *     else:
 *         # decode as raw objects
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_tuples, __pyx_v_t); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(3, 302, __pyx_L1_error)
    }

    /* "asynctnt/iproto/response.pyx":282
 *     tuples = []
 * 
 *     if req.parse_as_tuples:             # <<<<<<<<<<<<<<
 *         # decode as TarantoolTuples
 * 
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/response.pyx":305
 *     else:
 *         # decode as raw objects
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             tuples.append(_decode_obj(b, resp._encoding))
 * 
 */
  /*else*/ {
    __pyx_t_4 = __pyx_v_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "asynctnt/iproto/response.pyx":306
 *         # decode as raw objects
 *         for i in range(size):
 *             tuples.append(_decode_obj(b, resp._encoding))             # <<<<<<<<<<<<<<
 * 
 *     return tuples
 */
      __pyx_t_10 = __pyx_v_resp->_encoding;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol__decode_obj(__pyx_v_b, ((PyObject*)__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_tuples, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(3, 306, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }
  __pyx_L3:;

  /* "asynctnt/iproto/response.pyx":308
 *             tuples.append(_decode_obj(b, resp._encoding))
 * 
 *     return tuples             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tuples);
  __pyx_r = __pyx_v_tuples;
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":269
 * 
 * 
 * cdef list _response_parse_body_data(const char **b,             # <<<<<<<<<<<<<<
 *                                     Response resp, Request req):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol._response_parse_body_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tuples);
  __Pyx_XDECREF((PyObject *)__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":311
 * 
 * 
 * cdef ssize_t response_parse_header(const char *buf, uint32_t buf_len,             # <<<<<<<<<<<<<<
 *                                    Header *hdr) except -1:
 *     cdef:
 */

static Py_ssize_t __pyx_f_8asynctnt_6iproto_8protocol_response_parse_header(char const *__pyx_v_buf, CYTHON_UNUSED uint32_t __pyx_v_buf_len, struct __pyx_t_8asynctnt_6iproto_8protocol_Header *__pyx_v_hdr) {
  char const *__pyx_v_b;
  uint32_t __pyx_v_size;
  uint32_t __pyx_v_key;
  CYTHON_UNUSED uint32_t __pyx_v__;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  uint32_t __pyx_t_3;
  uint32_t __pyx_t_4;
  uint32_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  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("response_parse_header", 0);

  /* "asynctnt/iproto/response.pyx":318
 *         uint32_t key
 * 
 *     b = <const char*>buf             # <<<<<<<<<<<<<<
 *     # mp_fprint(stdio.stdout, b)
 *     # stdio.fprintf(stdio.stdout, "\n")
 */
  __pyx_v_b = ((char const *)__pyx_v_buf);

  /* "asynctnt/iproto/response.pyx":322
 *     # stdio.fprintf(stdio.stdout, "\n")
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover             # <<<<<<<<<<<<<<
 *         raise TypeError('Response header must be a MP_MAP')
 * 
 */
  __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_MAP) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/response.pyx":323
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover
 *         raise TypeError('Response header must be a MP_MAP')             # <<<<<<<<<<<<<<
 * 
 *     # parsing header
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 323, __pyx_L1_error)

    /* "asynctnt/iproto/response.pyx":322
 *     # stdio.fprintf(stdio.stdout, "\n")
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover             # <<<<<<<<<<<<<<
 *         raise TypeError('Response header must be a MP_MAP')
 * 
 */
  }

  /* "asynctnt/iproto/response.pyx":326
 * 
 *     # parsing header
 *     size = mp_decode_map(&b)             # <<<<<<<<<<<<<<
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 */
  __pyx_v_size = mp_decode_map((&__pyx_v_b));

  /* "asynctnt/iproto/response.pyx":327
 *     # parsing header
 *     size = mp_decode_map(&b)
 *     for _ in range(size):             # <<<<<<<<<<<<<<
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *             raise TypeError('Header key must be a MP_UINT')
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v__ = __pyx_t_5;

    /* "asynctnt/iproto/response.pyx":328
 *     size = mp_decode_map(&b)
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *             raise TypeError('Header key must be a MP_UINT')
 * 
 */
    __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_UINT) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/response.pyx":329
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *             raise TypeError('Header key must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *         key = mp_decode_uint(&b)
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 329, __pyx_L1_error)

      /* "asynctnt/iproto/response.pyx":328
 *     size = mp_decode_map(&b)
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *             raise TypeError('Header key must be a MP_UINT')
 * 
 */
    }

    /* "asynctnt/iproto/response.pyx":331
 *             raise TypeError('Header key must be a MP_UINT')
 * 
 *         key = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *         if key == tarantool.IPROTO_REQUEST_TYPE:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 */
    __pyx_v_key = mp_decode_uint((&__pyx_v_b));

    /* "asynctnt/iproto/response.pyx":332
 * 
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_REQUEST_TYPE:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('code type must be a MP_UINT')
 */
    switch (__pyx_v_key) {
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_REQUEST_TYPE:

      /* "asynctnt/iproto/response.pyx":333
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_REQUEST_TYPE:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('code type must be a MP_UINT')
 * 
 */
      __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_UINT) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/response.pyx":334
 *         if key == tarantool.IPROTO_REQUEST_TYPE:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('code type must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *             hdr.code = <uint32_t>mp_decode_uint(&b)
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 334, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(3, 334, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":333
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_REQUEST_TYPE:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('code type must be a MP_UINT')
 * 
 */
      }

      /* "asynctnt/iproto/response.pyx":336
 *                 raise TypeError('code type must be a MP_UINT')
 * 
 *             hdr.code = <uint32_t>mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *             hdr.return_code = hdr.code & 0x7FFF
 *         elif key == tarantool.IPROTO_SYNC:
 */
      __pyx_v_hdr->code = ((uint32_t)mp_decode_uint((&__pyx_v_b)));

      /* "asynctnt/iproto/response.pyx":337
 * 
 *             hdr.code = <uint32_t>mp_decode_uint(&b)
 *             hdr.return_code = hdr.code & 0x7FFF             # <<<<<<<<<<<<<<
 *         elif key == tarantool.IPROTO_SYNC:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 */
      __pyx_v_hdr->return_code = (__pyx_v_hdr->code & 0x7FFF);

      /* "asynctnt/iproto/response.pyx":332
 * 
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_REQUEST_TYPE:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('code type must be a MP_UINT')
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SYNC:

      /* "asynctnt/iproto/response.pyx":339
 *             hdr.return_code = hdr.code & 0x7FFF
 *         elif key == tarantool.IPROTO_SYNC:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('sync type must be a MP_UINT')
 * 
 */
      __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_UINT) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/response.pyx":340
 *         elif key == tarantool.IPROTO_SYNC:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('sync type must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *             hdr.sync = mp_decode_uint(&b)
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(3, 340, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":339
 *             hdr.return_code = hdr.code & 0x7FFF
 *         elif key == tarantool.IPROTO_SYNC:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('sync type must be a MP_UINT')
 * 
 */
      }

      /* "asynctnt/iproto/response.pyx":342
 *                 raise TypeError('sync type must be a MP_UINT')
 * 
 *             hdr.sync = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *         elif key == tarantool.IPROTO_SCHEMA_VERSION:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 */
      __pyx_v_hdr->sync = mp_decode_uint((&__pyx_v_b));

      /* "asynctnt/iproto/response.pyx":338
 *             hdr.code = <uint32_t>mp_decode_uint(&b)
 *             hdr.return_code = hdr.code & 0x7FFF
 *         elif key == tarantool.IPROTO_SYNC:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('sync type must be a MP_UINT')
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SCHEMA_VERSION:

      /* "asynctnt/iproto/response.pyx":344
 *             hdr.sync = mp_decode_uint(&b)
 *         elif key == tarantool.IPROTO_SCHEMA_VERSION:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('schema_id type must be a MP_UINT')
 * 
 */
      __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_UINT) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/response.pyx":345
 *         elif key == tarantool.IPROTO_SCHEMA_VERSION:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('schema_id type must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *             hdr.schema_id = mp_decode_uint(&b)
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(3, 345, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":344
 *             hdr.sync = mp_decode_uint(&b)
 *         elif key == tarantool.IPROTO_SCHEMA_VERSION:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('schema_id type must be a MP_UINT')
 * 
 */
      }

      /* "asynctnt/iproto/response.pyx":347
 *                 raise TypeError('schema_id type must be a MP_UINT')
 * 
 *             hdr.schema_id = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *         else:  # pragma: nocover
 *             logger.warning(
 */
      __pyx_v_hdr->schema_id = mp_decode_uint((&__pyx_v_b));

      /* "asynctnt/iproto/response.pyx":343
 * 
 *             hdr.sync = mp_decode_uint(&b)
 *         elif key == tarantool.IPROTO_SCHEMA_VERSION:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('schema_id type must be a MP_UINT')
 */
      break;
      default:

      /* "asynctnt/iproto/response.pyx":349
 *             hdr.schema_id = mp_decode_uint(&b)
 *         else:  # pragma: nocover
 *             logger.warning(             # <<<<<<<<<<<<<<
 *                 'Unknown key with code \'%d\' in header. Skipping.', key)
 *             mp_next(&b)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_warning); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "asynctnt/iproto/response.pyx":350
 *         else:  # pragma: nocover
 *             logger.warning(
 *                 'Unknown key with code \'%d\' in header. Skipping.', key)             # <<<<<<<<<<<<<<
 *             mp_next(&b)
 * 
 */
      __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 350, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(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);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Unknown_key_with_code_d_in_heade, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 349, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_Unknown_key_with_code_d_in_heade, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 349, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 349, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_Unknown_key_with_code_d_in_heade);
        __Pyx_GIVEREF(__pyx_kp_u_Unknown_key_with_code_d_in_heade);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_u_Unknown_key_with_code_d_in_heade);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 349, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asynctnt/iproto/response.pyx":351
 *             logger.warning(
 *                 'Unknown key with code \'%d\' in header. Skipping.', key)
 *             mp_next(&b)             # <<<<<<<<<<<<<<
 * 
 *     return <ssize_t>(b - buf)
 */
      mp_next((&__pyx_v_b));
      break;
    }
  }

  /* "asynctnt/iproto/response.pyx":353
 *             mp_next(&b)
 * 
 *     return <ssize_t>(b - buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((Py_ssize_t)(__pyx_v_b - __pyx_v_buf));
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":311
 * 
 * 
 * cdef ssize_t response_parse_header(const char *buf, uint32_t buf_len,             # <<<<<<<<<<<<<<
 *                                    Header *hdr) except -1:
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.response_parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/response.pyx":356
 * 
 * 
 * cdef ssize_t response_parse_body(const char *buf, uint32_t buf_len,             # <<<<<<<<<<<<<<
 *                                  Response resp, Request req,
 *                                  bint is_chunk) except -1:
 */

static Py_ssize_t __pyx_f_8asynctnt_6iproto_8protocol_response_parse_body(char const *__pyx_v_buf, CYTHON_UNUSED uint32_t __pyx_v_buf_len, struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_v_resp, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req, int __pyx_v_is_chunk) {
  char const *__pyx_v_b;
  uint32_t __pyx_v_size;
  uint32_t __pyx_v_arr_size;
  uint32_t __pyx_v_field_map_size;
  uint32_t __pyx_v_key;
  uint32_t __pyx_v_s_len;
  uint32_t __pyx_v_i;
  char const *__pyx_v_s;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_field_name = 0;
  CYTHON_UNUSED PyObject *__pyx_v_field_type = 0;
  CYTHON_UNUSED uint32_t __pyx_v__;
  uint32_t __pyx_v_field_id;
  PyObject *__pyx_v_ids = NULL;
  PyObject *__pyx_v_el = NULL;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  uint32_t __pyx_t_3;
  uint32_t __pyx_t_4;
  uint32_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  uint32_t __pyx_t_8;
  uint32_t __pyx_t_9;
  uint32_t __pyx_t_10;
  uint32_t __pyx_t_11;
  uint32_t __pyx_t_12;
  uint32_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("response_parse_body", 0);

  /* "asynctnt/iproto/response.pyx":371
 *         str field_name, field_type
 * 
 *     b = <const char*>buf             # <<<<<<<<<<<<<<
 *     # mp_fprint(stdio.stdout, b)
 *     # stdio.fprintf(stdio.stdout, "\n")
 */
  __pyx_v_b = ((char const *)__pyx_v_buf);

  /* "asynctnt/iproto/response.pyx":377
 *     # parsing body
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover             # <<<<<<<<<<<<<<
 *         raise TypeError('Response body must be a MP_MAP')
 * 
 */
  __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_MAP) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/response.pyx":378
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover
 *         raise TypeError('Response body must be a MP_MAP')             # <<<<<<<<<<<<<<
 * 
 *     size = mp_decode_map(&b)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 378, __pyx_L1_error)

    /* "asynctnt/iproto/response.pyx":377
 *     # parsing body
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover             # <<<<<<<<<<<<<<
 *         raise TypeError('Response body must be a MP_MAP')
 * 
 */
  }

  /* "asynctnt/iproto/response.pyx":380
 *         raise TypeError('Response body must be a MP_MAP')
 * 
 *     size = mp_decode_map(&b)             # <<<<<<<<<<<<<<
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 */
  __pyx_v_size = mp_decode_map((&__pyx_v_b));

  /* "asynctnt/iproto/response.pyx":381
 * 
 *     size = mp_decode_map(&b)
 *     for _ in range(size):             # <<<<<<<<<<<<<<
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *             raise TypeError('Header key must be a MP_UINT')
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v__ = __pyx_t_5;

    /* "asynctnt/iproto/response.pyx":382
 *     size = mp_decode_map(&b)
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *             raise TypeError('Header key must be a MP_UINT')
 * 
 */
    __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_UINT) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "asynctnt/iproto/response.pyx":383
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *             raise TypeError('Header key must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *         key = mp_decode_uint(&b)
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 383, __pyx_L1_error)

      /* "asynctnt/iproto/response.pyx":382
 *     size = mp_decode_map(&b)
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover             # <<<<<<<<<<<<<<
 *             raise TypeError('Header key must be a MP_UINT')
 * 
 */
    }

    /* "asynctnt/iproto/response.pyx":385
 *             raise TypeError('Header key must be a MP_UINT')
 * 
 *         key = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *         if key == tarantool.IPROTO_ERROR:
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover
 */
    __pyx_v_key = mp_decode_uint((&__pyx_v_b));

    /* "asynctnt/iproto/response.pyx":386
 * 
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_ERROR:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover
 *                 raise TypeError('errstr type must be a MP_STR')
 */
    switch (__pyx_v_key) {
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_ERROR:

      /* "asynctnt/iproto/response.pyx":387
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_ERROR:
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('errstr type must be a MP_STR')
 * 
 */
      __pyx_t_1 = ((mp_typeof((__pyx_v_b[0])) != MP_STR) != 0);
      if (unlikely(__pyx_t_1)) {

        /* "asynctnt/iproto/response.pyx":388
 *         if key == tarantool.IPROTO_ERROR:
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover
 *                 raise TypeError('errstr type must be a MP_STR')             # <<<<<<<<<<<<<<
 * 
 *             s = NULL
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(3, 388, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":387
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_ERROR:
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('errstr type must be a MP_STR')
 * 
 */
      }

      /* "asynctnt/iproto/response.pyx":390
 *                 raise TypeError('errstr type must be a MP_STR')
 * 
 *             s = NULL             # <<<<<<<<<<<<<<
 *             s_len = 0
 *             s = mp_decode_str(&b, &s_len)
 */
      __pyx_v_s = NULL;

      /* "asynctnt/iproto/response.pyx":391
 * 
 *             s = NULL
 *             s_len = 0             # <<<<<<<<<<<<<<
 *             s = mp_decode_str(&b, &s_len)
 *             resp._errmsg = decode_string(s[:s_len], resp._encoding)
 */
      __pyx_v_s_len = 0;

      /* "asynctnt/iproto/response.pyx":392
 *             s = NULL
 *             s_len = 0
 *             s = mp_decode_str(&b, &s_len)             # <<<<<<<<<<<<<<
 *             resp._errmsg = decode_string(s[:s_len], resp._encoding)
 *         elif key == tarantool.IPROTO_METADATA:
 */
      __pyx_v_s = mp_decode_str((&__pyx_v_b), (&__pyx_v_s_len));

      /* "asynctnt/iproto/response.pyx":393
 *             s_len = 0
 *             s = mp_decode_str(&b, &s_len)
 *             resp._errmsg = decode_string(s[:s_len], resp._encoding)             # <<<<<<<<<<<<<<
 *         elif key == tarantool.IPROTO_METADATA:
 *             if not req.parse_metadata:
 */
      __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_s_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __pyx_v_resp->_encoding;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = __pyx_f_8asynctnt_6iproto_8protocol_decode_string(((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_v_resp->_errmsg);
      __Pyx_DECREF(__pyx_v_resp->_errmsg);
      __pyx_v_resp->_errmsg = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/response.pyx":386
 * 
 *         key = mp_decode_uint(&b)
 *         if key == tarantool.IPROTO_ERROR:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover
 *                 raise TypeError('errstr type must be a MP_STR')
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_METADATA:

      /* "asynctnt/iproto/response.pyx":395
 *             resp._errmsg = decode_string(s[:s_len], resp._encoding)
 *         elif key == tarantool.IPROTO_METADATA:
 *             if not req.parse_metadata:             # <<<<<<<<<<<<<<
 *                 mp_next(&b)
 *                 continue
 */
      __pyx_t_1 = ((!(__pyx_v_req->parse_metadata != 0)) != 0);
      if (__pyx_t_1) {

        /* "asynctnt/iproto/response.pyx":396
 *         elif key == tarantool.IPROTO_METADATA:
 *             if not req.parse_metadata:
 *                 mp_next(&b)             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
        mp_next((&__pyx_v_b));

        /* "asynctnt/iproto/response.pyx":397
 *             if not req.parse_metadata:
 *                 mp_next(&b)
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             resp._fields = TntFields.__new__(TntFields)
 */
        goto __pyx_L4_continue;

        /* "asynctnt/iproto/response.pyx":395
 *             resp._errmsg = decode_string(s[:s_len], resp._encoding)
 *         elif key == tarantool.IPROTO_METADATA:
 *             if not req.parse_metadata:             # <<<<<<<<<<<<<<
 *                 mp_next(&b)
 *                 continue
 */
      }

      /* "asynctnt/iproto/response.pyx":399
 *                 continue
 * 
 *             resp._fields = TntFields.__new__(TntFields)             # <<<<<<<<<<<<<<
 * 
 *             arr_size = mp_decode_array(&b)
 */
      __pyx_t_7 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_TntFields), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 399, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __Pyx_GOTREF(__pyx_v_resp->_fields);
      __Pyx_DECREF(((PyObject *)__pyx_v_resp->_fields));
      __pyx_v_resp->_fields = ((struct C_TntFields *)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "asynctnt/iproto/response.pyx":401
 *             resp._fields = TntFields.__new__(TntFields)
 * 
 *             arr_size = mp_decode_array(&b)             # <<<<<<<<<<<<<<
 *             for i in range(arr_size):
 *                 field_map_size = mp_decode_map(&b)
 */
      __pyx_v_arr_size = mp_decode_array((&__pyx_v_b));

      /* "asynctnt/iproto/response.pyx":402
 * 
 *             arr_size = mp_decode_array(&b)
 *             for i in range(arr_size):             # <<<<<<<<<<<<<<
 *                 field_map_size = mp_decode_map(&b)
 *                 if field_map_size == 0:
 */
      __pyx_t_8 = __pyx_v_arr_size;
      __pyx_t_9 = __pyx_t_8;
      for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
        __pyx_v_i = __pyx_t_10;

        /* "asynctnt/iproto/response.pyx":403
 *             arr_size = mp_decode_array(&b)
 *             for i in range(arr_size):
 *                 field_map_size = mp_decode_map(&b)             # <<<<<<<<<<<<<<
 *                 if field_map_size == 0:
 *                     raise RuntimeError('Field map must contain at least '
 */
        __pyx_v_field_map_size = mp_decode_map((&__pyx_v_b));

        /* "asynctnt/iproto/response.pyx":404
 *             for i in range(arr_size):
 *                 field_map_size = mp_decode_map(&b)
 *                 if field_map_size == 0:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('Field map must contain at least '
 *                                        '1 element - field_name')
 */
        __pyx_t_1 = ((__pyx_v_field_map_size == 0) != 0);
        if (unlikely(__pyx_t_1)) {

          /* "asynctnt/iproto/response.pyx":405
 *                 field_map_size = mp_decode_map(&b)
 *                 if field_map_size == 0:
 *                     raise RuntimeError('Field map must contain at least '             # <<<<<<<<<<<<<<
 *                                        '1 element - field_name')
 * 
 */
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 405, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(3, 405, __pyx_L1_error)

          /* "asynctnt/iproto/response.pyx":404
 *             for i in range(arr_size):
 *                 field_map_size = mp_decode_map(&b)
 *                 if field_map_size == 0:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('Field map must contain at least '
 *                                        '1 element - field_name')
 */
        }

        /* "asynctnt/iproto/response.pyx":408
 *                                        '1 element - field_name')
 * 
 *                 field_id = i             # <<<<<<<<<<<<<<
 *                 field_name = None
 *                 field_type = None
 */
        __pyx_v_field_id = __pyx_v_i;

        /* "asynctnt/iproto/response.pyx":409
 * 
 *                 field_id = i
 *                 field_name = None             # <<<<<<<<<<<<<<
 *                 field_type = None
 *                 for _ in range(field_map_size):
 */
        __Pyx_INCREF(Py_None);
        __Pyx_XDECREF_SET(__pyx_v_field_name, ((PyObject*)Py_None));

        /* "asynctnt/iproto/response.pyx":410
 *                 field_id = i
 *                 field_name = None
 *                 field_type = None             # <<<<<<<<<<<<<<
 *                 for _ in range(field_map_size):
 *                     key = mp_decode_uint(&b)
 */
        __Pyx_INCREF(Py_None);
        __Pyx_XDECREF_SET(__pyx_v_field_type, ((PyObject*)Py_None));

        /* "asynctnt/iproto/response.pyx":411
 *                 field_name = None
 *                 field_type = None
 *                 for _ in range(field_map_size):             # <<<<<<<<<<<<<<
 *                     key = mp_decode_uint(&b)
 *                     if key == tarantool.IPROTO_FIELD_NAME:
 */
        __pyx_t_11 = __pyx_v_field_map_size;
        __pyx_t_12 = __pyx_t_11;
        for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
          __pyx_v__ = __pyx_t_13;

          /* "asynctnt/iproto/response.pyx":412
 *                 field_type = None
 *                 for _ in range(field_map_size):
 *                     key = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *                     if key == tarantool.IPROTO_FIELD_NAME:
 *                         s = NULL
 */
          __pyx_v_key = mp_decode_uint((&__pyx_v_b));

          /* "asynctnt/iproto/response.pyx":413
 *                 for _ in range(field_map_size):
 *                     key = mp_decode_uint(&b)
 *                     if key == tarantool.IPROTO_FIELD_NAME:             # <<<<<<<<<<<<<<
 *                         s = NULL
 *                         s_len = 0
 */
          switch (__pyx_v_key) {
            case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_FIELD_NAME:

            /* "asynctnt/iproto/response.pyx":414
 *                     key = mp_decode_uint(&b)
 *                     if key == tarantool.IPROTO_FIELD_NAME:
 *                         s = NULL             # <<<<<<<<<<<<<<
 *                         s_len = 0
 *                         s = mp_decode_str(&b, &s_len)
 */
            __pyx_v_s = NULL;

            /* "asynctnt/iproto/response.pyx":415
 *                     if key == tarantool.IPROTO_FIELD_NAME:
 *                         s = NULL
 *                         s_len = 0             # <<<<<<<<<<<<<<
 *                         s = mp_decode_str(&b, &s_len)
 *                         field_name = \
 */
            __pyx_v_s_len = 0;

            /* "asynctnt/iproto/response.pyx":416
 *                         s = NULL
 *                         s_len = 0
 *                         s = mp_decode_str(&b, &s_len)             # <<<<<<<<<<<<<<
 *                         field_name = \
 *                             decode_string(s[:s_len], resp._encoding)
 */
            __pyx_v_s = mp_decode_str((&__pyx_v_b), (&__pyx_v_s_len));

            /* "asynctnt/iproto/response.pyx":418
 *                         s = mp_decode_str(&b, &s_len)
 *                         field_name = \
 *                             decode_string(s[:s_len], resp._encoding)             # <<<<<<<<<<<<<<
 *                     elif key == tarantool.IPROTO_FIELD_TYPE:
 *                         s = NULL
 */
            __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_s_len - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 418, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_6 = __pyx_v_resp->_encoding;
            __Pyx_INCREF(__pyx_t_6);
            __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_decode_string(((PyObject*)__pyx_t_7), ((PyObject*)__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 418, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF_SET(__pyx_v_field_name, ((PyObject*)__pyx_t_2));
            __pyx_t_2 = 0;

            /* "asynctnt/iproto/response.pyx":413
 *                 for _ in range(field_map_size):
 *                     key = mp_decode_uint(&b)
 *                     if key == tarantool.IPROTO_FIELD_NAME:             # <<<<<<<<<<<<<<
 *                         s = NULL
 *                         s_len = 0
 */
            break;
            case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_FIELD_TYPE:

            /* "asynctnt/iproto/response.pyx":420
 *                             decode_string(s[:s_len], resp._encoding)
 *                     elif key == tarantool.IPROTO_FIELD_TYPE:
 *                         s = NULL             # <<<<<<<<<<<<<<
 *                         s_len = 0
 *                         s = mp_decode_str(&b, &s_len)
 */
            __pyx_v_s = NULL;

            /* "asynctnt/iproto/response.pyx":421
 *                     elif key == tarantool.IPROTO_FIELD_TYPE:
 *                         s = NULL
 *                         s_len = 0             # <<<<<<<<<<<<<<
 *                         s = mp_decode_str(&b, &s_len)
 *                         field_type = \
 */
            __pyx_v_s_len = 0;

            /* "asynctnt/iproto/response.pyx":422
 *                         s = NULL
 *                         s_len = 0
 *                         s = mp_decode_str(&b, &s_len)             # <<<<<<<<<<<<<<
 *                         field_type = \
 *                             decode_string(s[:s_len], resp._encoding)
 */
            __pyx_v_s = mp_decode_str((&__pyx_v_b), (&__pyx_v_s_len));

            /* "asynctnt/iproto/response.pyx":424
 *                         s = mp_decode_str(&b, &s_len)
 *                         field_type = \
 *                             decode_string(s[:s_len], resp._encoding)             # <<<<<<<<<<<<<<
 *                     else:
 *                         logger.warning(
 */
            __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_s_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 424, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_6 = __pyx_v_resp->_encoding;
            __Pyx_INCREF(__pyx_t_6);
            __pyx_t_7 = __pyx_f_8asynctnt_6iproto_8protocol_decode_string(((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 424, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF_SET(__pyx_v_field_type, ((PyObject*)__pyx_t_7));
            __pyx_t_7 = 0;

            /* "asynctnt/iproto/response.pyx":419
 *                         field_name = \
 *                             decode_string(s[:s_len], resp._encoding)
 *                     elif key == tarantool.IPROTO_FIELD_TYPE:             # <<<<<<<<<<<<<<
 *                         s = NULL
 *                         s_len = 0
 */
            break;
            default:

            /* "asynctnt/iproto/response.pyx":426
 *                             decode_string(s[:s_len], resp._encoding)
 *                     else:
 *                         logger.warning(             # <<<<<<<<<<<<<<
 *                             'unknown key in metadata decoding: %d', key)
 *                         mp_next(&b)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 426, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 426, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "asynctnt/iproto/response.pyx":427
 *                     else:
 *                         logger.warning(
 *                             'unknown key in metadata decoding: %d', key)             # <<<<<<<<<<<<<<
 *                         mp_next(&b)
 * 
 */
            __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_14 = NULL;
            __pyx_t_15 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_14)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_14);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
                __pyx_t_15 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_2)) {
              PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_kp_u_unknown_key_in_metadata_decoding, __pyx_t_6};
              __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 426, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
              PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_kp_u_unknown_key_in_metadata_decoding, __pyx_t_6};
              __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 426, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            } else
            #endif
            {
              __pyx_t_16 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 426, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_16);
              if (__pyx_t_14) {
                __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL;
              }
              __Pyx_INCREF(__pyx_kp_u_unknown_key_in_metadata_decoding);
              __Pyx_GIVEREF(__pyx_kp_u_unknown_key_in_metadata_decoding);
              PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_15, __pyx_kp_u_unknown_key_in_metadata_decoding);
              __Pyx_GIVEREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_15, __pyx_t_6);
              __pyx_t_6 = 0;
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 426, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "asynctnt/iproto/response.pyx":428
 *                         logger.warning(
 *                             'unknown key in metadata decoding: %d', key)
 *                         mp_next(&b)             # <<<<<<<<<<<<<<
 * 
 *                 if field_name is None:
 */
            mp_next((&__pyx_v_b));
            break;
          }
        }

        /* "asynctnt/iproto/response.pyx":430
 *                         mp_next(&b)
 * 
 *                 if field_name is None:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('field_name must not be None')
 * 
 */
        __pyx_t_1 = (__pyx_v_field_name == ((PyObject*)Py_None));
        __pyx_t_17 = (__pyx_t_1 != 0);
        if (unlikely(__pyx_t_17)) {

          /* "asynctnt/iproto/response.pyx":431
 * 
 *                 if field_name is None:
 *                     raise RuntimeError('field_name must not be None')             # <<<<<<<<<<<<<<
 * 
 *                 resp._fields.add(field_id, field_name)
 */
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 431, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(3, 431, __pyx_L1_error)

          /* "asynctnt/iproto/response.pyx":430
 *                         mp_next(&b)
 * 
 *                 if field_name is None:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('field_name must not be None')
 * 
 */
        }

        /* "asynctnt/iproto/response.pyx":433
 *                     raise RuntimeError('field_name must not be None')
 * 
 *                 resp._fields.add(field_id, field_name)             # <<<<<<<<<<<<<<
 * 
 *         elif key == tarantool.IPROTO_SQL_INFO:
 */
        __pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add(__pyx_v_resp->_fields, __pyx_v_field_id, __pyx_v_field_name);
      }

      /* "asynctnt/iproto/response.pyx":394
 *             s = mp_decode_str(&b, &s_len)
 *             resp._errmsg = decode_string(s[:s_len], resp._encoding)
 *         elif key == tarantool.IPROTO_METADATA:             # <<<<<<<<<<<<<<
 *             if not req.parse_metadata:
 *                 mp_next(&b)
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SQL_INFO:

      /* "asynctnt/iproto/response.pyx":436
 * 
 *         elif key == tarantool.IPROTO_SQL_INFO:
 *             field_map_size = mp_decode_map(&b)             # <<<<<<<<<<<<<<
 *             if field_map_size == 0:
 *                 raise RuntimeError('Field map must contain at least '
 */
      __pyx_v_field_map_size = mp_decode_map((&__pyx_v_b));

      /* "asynctnt/iproto/response.pyx":437
 *         elif key == tarantool.IPROTO_SQL_INFO:
 *             field_map_size = mp_decode_map(&b)
 *             if field_map_size == 0:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Field map must contain at least '
 *                                    '1 element - rowcount')
 */
      __pyx_t_17 = ((__pyx_v_field_map_size == 0) != 0);
      if (unlikely(__pyx_t_17)) {

        /* "asynctnt/iproto/response.pyx":438
 *             field_map_size = mp_decode_map(&b)
 *             if field_map_size == 0:
 *                 raise RuntimeError('Field map must contain at least '             # <<<<<<<<<<<<<<
 *                                    '1 element - rowcount')
 * 
 */
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(3, 438, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":437
 *         elif key == tarantool.IPROTO_SQL_INFO:
 *             field_map_size = mp_decode_map(&b)
 *             if field_map_size == 0:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('Field map must contain at least '
 *                                    '1 element - rowcount')
 */
      }

      /* "asynctnt/iproto/response.pyx":441
 *                                    '1 element - rowcount')
 * 
 *             for _ in range(field_map_size):             # <<<<<<<<<<<<<<
 *                 key = mp_decode_uint(&b)
 *                 if key == tarantool.SQL_INFO_ROW_COUNT:
 */
      __pyx_t_8 = __pyx_v_field_map_size;
      __pyx_t_9 = __pyx_t_8;
      for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
        __pyx_v__ = __pyx_t_10;

        /* "asynctnt/iproto/response.pyx":442
 * 
 *             for _ in range(field_map_size):
 *                 key = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *                 if key == tarantool.SQL_INFO_ROW_COUNT:
 *                     resp._rowcount = mp_decode_uint(&b)
 */
        __pyx_v_key = mp_decode_uint((&__pyx_v_b));

        /* "asynctnt/iproto/response.pyx":443
 *             for _ in range(field_map_size):
 *                 key = mp_decode_uint(&b)
 *                 if key == tarantool.SQL_INFO_ROW_COUNT:             # <<<<<<<<<<<<<<
 *                     resp._rowcount = mp_decode_uint(&b)
 *                 elif key == tarantool.SQL_INFO_AUTOINCREMENT_IDS:
 */
        switch (__pyx_v_key) {
          case __pyx_e_8asynctnt_6iproto_9tarantool_SQL_INFO_ROW_COUNT:

          /* "asynctnt/iproto/response.pyx":444
 *                 key = mp_decode_uint(&b)
 *                 if key == tarantool.SQL_INFO_ROW_COUNT:
 *                     resp._rowcount = mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *                 elif key == tarantool.SQL_INFO_AUTOINCREMENT_IDS:
 *                     arr_size = mp_decode_array(&b)
 */
          __pyx_v_resp->_rowcount = mp_decode_uint((&__pyx_v_b));

          /* "asynctnt/iproto/response.pyx":443
 *             for _ in range(field_map_size):
 *                 key = mp_decode_uint(&b)
 *                 if key == tarantool.SQL_INFO_ROW_COUNT:             # <<<<<<<<<<<<<<
 *                     resp._rowcount = mp_decode_uint(&b)
 *                 elif key == tarantool.SQL_INFO_AUTOINCREMENT_IDS:
 */
          break;
          case __pyx_e_8asynctnt_6iproto_9tarantool_SQL_INFO_AUTOINCREMENT_IDS:

          /* "asynctnt/iproto/response.pyx":446
 *                     resp._rowcount = mp_decode_uint(&b)
 *                 elif key == tarantool.SQL_INFO_AUTOINCREMENT_IDS:
 *                     arr_size = mp_decode_array(&b)             # <<<<<<<<<<<<<<
 *                     ids = cpython.list.PyList_New(arr_size)
 *                     for i in range(arr_size):
 */
          __pyx_v_arr_size = mp_decode_array((&__pyx_v_b));

          /* "asynctnt/iproto/response.pyx":447
 *                 elif key == tarantool.SQL_INFO_AUTOINCREMENT_IDS:
 *                     arr_size = mp_decode_array(&b)
 *                     ids = cpython.list.PyList_New(arr_size)             # <<<<<<<<<<<<<<
 *                     for i in range(arr_size):
 *                         el = <object>mp_decode_uint(&b)
 */
          __pyx_t_7 = PyList_New(__pyx_v_arr_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 447, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF_SET(__pyx_v_ids, ((PyObject*)__pyx_t_7));
          __pyx_t_7 = 0;

          /* "asynctnt/iproto/response.pyx":448
 *                     arr_size = mp_decode_array(&b)
 *                     ids = cpython.list.PyList_New(arr_size)
 *                     for i in range(arr_size):             # <<<<<<<<<<<<<<
 *                         el = <object>mp_decode_uint(&b)
 *                         cpython.Py_INCREF(el)
 */
          __pyx_t_11 = __pyx_v_arr_size;
          __pyx_t_12 = __pyx_t_11;
          for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
            __pyx_v_i = __pyx_t_13;

            /* "asynctnt/iproto/response.pyx":449
 *                     ids = cpython.list.PyList_New(arr_size)
 *                     for i in range(arr_size):
 *                         el = <object>mp_decode_uint(&b)             # <<<<<<<<<<<<<<
 *                         cpython.Py_INCREF(el)
 *                         cpython.list.PyList_SET_ITEM(ids, i, el)
 */
            __pyx_t_7 = __Pyx_PyInt_From_uint64_t(mp_decode_uint((&__pyx_v_b))); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 449, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_2 = __pyx_t_7;
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "asynctnt/iproto/response.pyx":450
 *                     for i in range(arr_size):
 *                         el = <object>mp_decode_uint(&b)
 *                         cpython.Py_INCREF(el)             # <<<<<<<<<<<<<<
 *                         cpython.list.PyList_SET_ITEM(ids, i, el)
 *                     resp._autoincrement_ids = ids
 */
            Py_INCREF(__pyx_v_el);

            /* "asynctnt/iproto/response.pyx":451
 *                         el = <object>mp_decode_uint(&b)
 *                         cpython.Py_INCREF(el)
 *                         cpython.list.PyList_SET_ITEM(ids, i, el)             # <<<<<<<<<<<<<<
 *                     resp._autoincrement_ids = ids
 *                 else:
 */
            PyList_SET_ITEM(__pyx_v_ids, __pyx_v_i, __pyx_v_el);
          }

          /* "asynctnt/iproto/response.pyx":452
 *                         cpython.Py_INCREF(el)
 *                         cpython.list.PyList_SET_ITEM(ids, i, el)
 *                     resp._autoincrement_ids = ids             # <<<<<<<<<<<<<<
 *                 else:
 *                     logger.warning('unknown key in sql info decoding: %d', key)
 */
          __Pyx_INCREF(__pyx_v_ids);
          __Pyx_GIVEREF(__pyx_v_ids);
          __Pyx_GOTREF(__pyx_v_resp->_autoincrement_ids);
          __Pyx_DECREF(__pyx_v_resp->_autoincrement_ids);
          __pyx_v_resp->_autoincrement_ids = __pyx_v_ids;

          /* "asynctnt/iproto/response.pyx":445
 *                 if key == tarantool.SQL_INFO_ROW_COUNT:
 *                     resp._rowcount = mp_decode_uint(&b)
 *                 elif key == tarantool.SQL_INFO_AUTOINCREMENT_IDS:             # <<<<<<<<<<<<<<
 *                     arr_size = mp_decode_array(&b)
 *                     ids = cpython.list.PyList_New(arr_size)
 */
          break;
          default:

          /* "asynctnt/iproto/response.pyx":454
 *                     resp._autoincrement_ids = ids
 *                 else:
 *                     logger.warning('unknown key in sql info decoding: %d', key)             # <<<<<<<<<<<<<<
 *                     mp_next(&b)
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 454, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_warning); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 454, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 454, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = NULL;
          __pyx_t_15 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_16);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_16, function);
              __pyx_t_15 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_16)) {
            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_unknown_key_in_sql_info_decoding, __pyx_t_7};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 454, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) {
            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_unknown_key_in_sql_info_decoding, __pyx_t_7};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 454, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 454, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (__pyx_t_6) {
              __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); __pyx_t_6 = NULL;
            }
            __Pyx_INCREF(__pyx_kp_u_unknown_key_in_sql_info_decoding);
            __Pyx_GIVEREF(__pyx_kp_u_unknown_key_in_sql_info_decoding);
            PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_15, __pyx_kp_u_unknown_key_in_sql_info_decoding);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_15, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 454, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "asynctnt/iproto/response.pyx":455
 *                 else:
 *                     logger.warning('unknown key in sql info decoding: %d', key)
 *                     mp_next(&b)             # <<<<<<<<<<<<<<
 * 
 *         elif key == tarantool.IPROTO_DATA:
 */
          mp_next((&__pyx_v_b));
          break;
        }
      }

      /* "asynctnt/iproto/response.pyx":435
 *                 resp._fields.add(field_id, field_name)
 * 
 *         elif key == tarantool.IPROTO_SQL_INFO:             # <<<<<<<<<<<<<<
 *             field_map_size = mp_decode_map(&b)
 *             if field_map_size == 0:
 */
      break;
      case __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_DATA:

      /* "asynctnt/iproto/response.pyx":458
 * 
 *         elif key == tarantool.IPROTO_DATA:
 *             if mp_typeof(b[0]) != MP_ARRAY:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('body data type must be a MP_ARRAY')
 *             data = _response_parse_body_data(&b, resp, req)
 */
      __pyx_t_17 = ((mp_typeof((__pyx_v_b[0])) != MP_ARRAY) != 0);
      if (unlikely(__pyx_t_17)) {

        /* "asynctnt/iproto/response.pyx":459
 *         elif key == tarantool.IPROTO_DATA:
 *             if mp_typeof(b[0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError('body data type must be a MP_ARRAY')             # <<<<<<<<<<<<<<
 *             data = _response_parse_body_data(&b, resp, req)
 *             if is_chunk:
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 459, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(3, 459, __pyx_L1_error)

        /* "asynctnt/iproto/response.pyx":458
 * 
 *         elif key == tarantool.IPROTO_DATA:
 *             if mp_typeof(b[0]) != MP_ARRAY:  # pragma: nocover             # <<<<<<<<<<<<<<
 *                 raise TypeError('body data type must be a MP_ARRAY')
 *             data = _response_parse_body_data(&b, resp, req)
 */
      }

      /* "asynctnt/iproto/response.pyx":460
 *             if mp_typeof(b[0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError('body data type must be a MP_ARRAY')
 *             data = _response_parse_body_data(&b, resp, req)             # <<<<<<<<<<<<<<
 *             if is_chunk:
 *                 resp.add_push(data)
 */
      __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol__response_parse_body_data((&__pyx_v_b), __pyx_v_resp, __pyx_v_req); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 460, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_data, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asynctnt/iproto/response.pyx":461
 *                 raise TypeError('body data type must be a MP_ARRAY')
 *             data = _response_parse_body_data(&b, resp, req)
 *             if is_chunk:             # <<<<<<<<<<<<<<
 *                 resp.add_push(data)
 *             else:
 */
      __pyx_t_17 = (__pyx_v_is_chunk != 0);
      if (__pyx_t_17) {

        /* "asynctnt/iproto/response.pyx":462
 *             data = _response_parse_body_data(&b, resp, req)
 *             if is_chunk:
 *                 resp.add_push(data)             # <<<<<<<<<<<<<<
 *             else:
 *                 resp.set_data(data)
 */
        __pyx_f_8asynctnt_6iproto_8protocol_8Response_add_push(__pyx_v_resp, __pyx_v_data);

        /* "asynctnt/iproto/response.pyx":461
 *                 raise TypeError('body data type must be a MP_ARRAY')
 *             data = _response_parse_body_data(&b, resp, req)
 *             if is_chunk:             # <<<<<<<<<<<<<<
 *                 resp.add_push(data)
 *             else:
 */
        goto __pyx_L21;
      }

      /* "asynctnt/iproto/response.pyx":464
 *                 resp.add_push(data)
 *             else:
 *                 resp.set_data(data)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      /*else*/ {
        __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_data(__pyx_v_resp, __pyx_v_data);
      }
      __pyx_L21:;

      /* "asynctnt/iproto/response.pyx":457
 *                     mp_next(&b)
 * 
 *         elif key == tarantool.IPROTO_DATA:             # <<<<<<<<<<<<<<
 *             if mp_typeof(b[0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError('body data type must be a MP_ARRAY')
 */
      break;
      default:

      /* "asynctnt/iproto/response.pyx":467
 * 
 *         else:
 *             logger.warning('unknown key in body map: %d', int(key))             # <<<<<<<<<<<<<<
 *             mp_next(&b)
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_warning); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __Pyx_PyInt_From_uint32_t(__pyx_v_key); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = NULL;
      __pyx_t_15 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_16)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_16);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
          __pyx_t_15 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_kp_u_unknown_key_in_body_map_d, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 467, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_kp_u_unknown_key_in_body_map_d, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 467, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_16) {
          __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_16); __pyx_t_16 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_unknown_key_in_body_map_d);
        __Pyx_GIVEREF(__pyx_kp_u_unknown_key_in_body_map_d);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_15, __pyx_kp_u_unknown_key_in_body_map_d);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_15, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asynctnt/iproto/response.pyx":468
 *         else:
 *             logger.warning('unknown key in body map: %d', int(key))
 *             mp_next(&b)             # <<<<<<<<<<<<<<
 * 
 *     return <ssize_t>(b - buf)
 */
      mp_next((&__pyx_v_b));
      break;
    }
    __pyx_L4_continue:;
  }

  /* "asynctnt/iproto/response.pyx":470
 *             mp_next(&b)
 * 
 *     return <ssize_t>(b - buf)             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((Py_ssize_t)(__pyx_v_b - __pyx_v_buf));
  goto __pyx_L0;

  /* "asynctnt/iproto/response.pyx":356
 * 
 * 
 * cdef ssize_t response_parse_body(const char *buf, uint32_t buf_len,             # <<<<<<<<<<<<<<
 *                                  Response resp, Request req,
 *                                  bint is_chunk) except -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.response_parse_body", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_field_name);
  __Pyx_XDECREF(__pyx_v_field_type);
  __Pyx_XDECREF(__pyx_v_ids);
  __Pyx_XDECREF(__pyx_v_el);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":6
 * 
 * cdef class Db:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._protocol = None
 *         self._encoding = None
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_2Db_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_2Db_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db___cinit__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self));

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_2Db___cinit__(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asynctnt/iproto/db.pyx":7
 * cdef class Db:
 *     def __cinit__(self):
 *         self._protocol = None             # <<<<<<<<<<<<<<
 *         self._encoding = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_protocol);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_protocol));
  __pyx_v_self->_protocol = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)Py_None);

  /* "asynctnt/iproto/db.pyx":8
 *     def __cinit__(self):
 *         self._protocol = None
 *         self._encoding = None             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_encoding);
  __Pyx_DECREF(__pyx_v_self->_encoding);
  __pyx_v_self->_encoding = ((PyObject*)Py_None);

  /* "asynctnt/iproto/db.pyx":6
 * 
 * cdef class Db:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._protocol = None
 *         self._encoding = None
 */

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

/* "asynctnt/iproto/db.pyx":11
 * 
 *     @staticmethod
 *     cdef inline Db new(BaseProtocol protocol):             # <<<<<<<<<<<<<<
 *         cdef Db db = Db.__new__(Db)
 *         db._protocol = protocol
 */

static CYTHON_INLINE struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_f_8asynctnt_6iproto_8protocol_2Db_new(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_protocol) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_db = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 0);

  /* "asynctnt/iproto/db.pyx":12
 *     @staticmethod
 *     cdef inline Db new(BaseProtocol protocol):
 *         cdef Db db = Db.__new__(Db)             # <<<<<<<<<<<<<<
 *         db._protocol = protocol
 *         db._encoding = protocol.encoding
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_Db(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_Db), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_db = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":13
 *     cdef inline Db new(BaseProtocol protocol):
 *         cdef Db db = Db.__new__(Db)
 *         db._protocol = protocol             # <<<<<<<<<<<<<<
 *         db._encoding = protocol.encoding
 *         return db
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_protocol));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_protocol));
  __Pyx_GOTREF(__pyx_v_db->_protocol);
  __Pyx_DECREF(((PyObject *)__pyx_v_db->_protocol));
  __pyx_v_db->_protocol = __pyx_v_protocol;

  /* "asynctnt/iproto/db.pyx":14
 *         cdef Db db = Db.__new__(Db)
 *         db._protocol = protocol
 *         db._encoding = protocol.encoding             # <<<<<<<<<<<<<<
 *         return db
 * 
 */
  __pyx_t_1 = __pyx_v_protocol->__pyx_base.encoding;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_db->_encoding);
  __Pyx_DECREF(__pyx_v_db->_encoding);
  __pyx_v_db->_encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":15
 *         db._protocol = protocol
 *         db._encoding = protocol.encoding
 *         return db             # <<<<<<<<<<<<<<
 * 
 *     cdef inline uint64_t next_sync(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_db));
  __pyx_r = __pyx_v_db;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":11
 * 
 *     @staticmethod
 *     cdef inline Db new(BaseProtocol protocol):             # <<<<<<<<<<<<<<
 *         cdef Db db = Db.__new__(Db)
 *         db._protocol = protocol
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_db);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":17
 *         return db
 * 
 *     cdef inline uint64_t next_sync(self):             # <<<<<<<<<<<<<<
 *         return self._protocol.next_sync()
 * 
 */

static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self) {
  uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_sync", 0);

  /* "asynctnt/iproto/db.pyx":18
 * 
 *     cdef inline uint64_t next_sync(self):
 *         return self._protocol.next_sync()             # <<<<<<<<<<<<<<
 * 
 *     cdef object _ping(self, float timeout, bint push_subscribe):
 */
  __pyx_r = __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_next_sync(__pyx_v_self->_protocol);
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":17
 *         return db
 * 
 *     cdef inline uint64_t next_sync(self):             # <<<<<<<<<<<<<<
 *         return self._protocol.next_sync()
 * 
 */

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

/* "asynctnt/iproto/db.pyx":20
 *         return self._protocol.next_sync()
 * 
 *     cdef object _ping(self, float timeout, bint push_subscribe):             # <<<<<<<<<<<<<<
 *         cdef:
 *             tarantool.iproto_type op
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__ping(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ping", 0);

  /* "asynctnt/iproto/db.pyx":27
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_PING             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_PING;

  /* "asynctnt/iproto/db.pyx":28
 * 
 *         op = tarantool.IPROTO_PING
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":29
 *         op = tarantool.IPROTO_PING
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":30
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.write_length()
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":31
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 31, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":32
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":33
 *         buf.write_header(sync, op, schema_id)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":34
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None), __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":33
 *         buf.write_header(sync, op, schema_id)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":20
 *         return self._protocol.next_sync()
 * 
 *     cdef object _ping(self, float timeout, bint push_subscribe):             # <<<<<<<<<<<<<<
 *         cdef:
 *             tarantool.iproto_type op
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":37
 *             buf, timeout)
 * 
 *     cdef object _call16(self, str func_name, args,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__call16(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call16", 0);

  /* "asynctnt/iproto/db.pyx":45
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_CALL_16             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CALL_16;

  /* "asynctnt/iproto/db.pyx":46
 * 
 *         op = tarantool.IPROTO_CALL_16
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":47
 *         op = tarantool.IPROTO_CALL_16
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":48
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_call(func_name, args)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":49
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 49, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":50
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_call(func_name, args)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_call(__pyx_v_buf, __pyx_v_func_name, __pyx_v_args); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 50, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":51
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":52
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":53
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None), __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":52
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":37
 *             buf, timeout)
 * 
 *     cdef object _call16(self, str func_name, args,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._call16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":56
 *             buf, timeout)
 * 
 *     cdef object _call(self, str func_name, args,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__call(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call", 0);

  /* "asynctnt/iproto/db.pyx":64
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_CALL             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CALL;

  /* "asynctnt/iproto/db.pyx":65
 * 
 *         op = tarantool.IPROTO_CALL
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":66
 *         op = tarantool.IPROTO_CALL
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":67
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_call(func_name, args)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":68
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 68, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":69
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_call(func_name, args)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_call(__pyx_v_buf, __pyx_v_func_name, __pyx_v_args); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 69, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":70
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":71
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":72
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None), __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":71
 *         buf.encode_request_call(func_name, args)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":56
 *             buf, timeout)
 * 
 *     cdef object _call(self, str func_name, args,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":75
 *             buf, timeout)
 * 
 *     cdef object _eval(self, str expression, args,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_expression, PyObject *__pyx_v_args, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_eval", 0);

  /* "asynctnt/iproto/db.pyx":83
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_EVAL             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_EVAL;

  /* "asynctnt/iproto/db.pyx":84
 * 
 *         op = tarantool.IPROTO_EVAL
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":85
 *         op = tarantool.IPROTO_EVAL
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":86
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_eval(expression, args)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":87
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_eval(expression, args)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 87, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":88
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_eval(expression, args)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_eval(__pyx_v_buf, __pyx_v_expression, __pyx_v_args); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 88, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":89
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_eval(expression, args)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":90
 *         buf.encode_request_eval(expression, args)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":91
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None), __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":90
 *         buf.encode_request_eval(expression, args)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":75
 *             buf, timeout)
 * 
 *     cdef object _eval(self, str expression, args,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":94
 *             buf, timeout)
 * 
 *     cdef object _select(self, SchemaSpace space, SchemaIndex index, key,             # <<<<<<<<<<<<<<
 *                          uint64_t offset, uint64_t limit, uint32_t iterator,
 *                          float timeout, bint push_subscribe):
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__select(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, uint64_t __pyx_v_offset, uint64_t __pyx_v_limit, uint32_t __pyx_v_iterator, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_select", 0);

  /* "asynctnt/iproto/db.pyx":103
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_SELECT             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_SELECT;

  /* "asynctnt/iproto/db.pyx":104
 * 
 *         op = tarantool.IPROTO_SELECT
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":105
 *         op = tarantool.IPROTO_SELECT
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":106
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_select(space, index, key,
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":107
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_select(space, index, key,
 *                                   offset, limit, iterator)
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 107, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":108
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_select(space, index, key,             # <<<<<<<<<<<<<<
 *                                   offset, limit, iterator)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_select(__pyx_v_buf, __pyx_v_space, __pyx_v_index, __pyx_v_key, __pyx_v_offset, __pyx_v_limit, __pyx_v_iterator); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 108, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":110
 *         buf.encode_request_select(space, index, key,
 *                                   offset, limit, iterator)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":111
 *                                   offset, limit, iterator)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":112
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, __pyx_v_space, __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":111
 *                                   offset, limit, iterator)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":94
 *             buf, timeout)
 * 
 *     cdef object _select(self, SchemaSpace space, SchemaIndex index, key,             # <<<<<<<<<<<<<<
 *                          uint64_t offset, uint64_t limit, uint32_t iterator,
 *                          float timeout, bint push_subscribe):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":115
 *             buf, timeout)
 * 
 *     cdef object _insert(self, SchemaSpace space, t, bint replace,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t, int __pyx_v_replace, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_t_1;
  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("_insert", 0);

  /* "asynctnt/iproto/db.pyx":123
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_REPLACE if replace else tarantool.IPROTO_INSERT             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  if ((__pyx_v_replace != 0)) {
    __pyx_t_1 = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_REPLACE;
  } else {
    __pyx_t_1 = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_INSERT;
  }
  __pyx_v_op = __pyx_t_1;

  /* "asynctnt/iproto/db.pyx":124
 * 
 *         op = tarantool.IPROTO_REPLACE if replace else tarantool.IPROTO_INSERT
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":125
 *         op = tarantool.IPROTO_REPLACE if replace else tarantool.IPROTO_INSERT
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":126
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_insert(space, t)
 */
  __pyx_t_2 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asynctnt/iproto/db.pyx":127
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_insert(space, t)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 127, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":128
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_insert(space, t)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_insert(__pyx_v_buf, __pyx_v_space, __pyx_v_t); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 128, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":129
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_insert(space, t)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":130
 *         buf.encode_request_insert(space, t)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":131
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, __pyx_v_space, __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "asynctnt/iproto/db.pyx":130
 *         buf.encode_request_insert(space, t)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_3), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 130, __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;

  /* "asynctnt/iproto/db.pyx":115
 *             buf, timeout)
 * 
 *     cdef object _insert(self, SchemaSpace space, t, bint replace,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":134
 *             buf, timeout)
 * 
 *     cdef object _delete(self, SchemaSpace space, SchemaIndex index, key,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delete", 0);

  /* "asynctnt/iproto/db.pyx":142
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_DELETE             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_DELETE;

  /* "asynctnt/iproto/db.pyx":143
 * 
 *         op = tarantool.IPROTO_DELETE
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":144
 *         op = tarantool.IPROTO_DELETE
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":145
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_delete(space, index, key)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":146
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_delete(space, index, key)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 146, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":147
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_delete(space, index, key)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_delete(__pyx_v_buf, __pyx_v_space, __pyx_v_index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 147, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":148
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_delete(space, index, key)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":149
 *         buf.encode_request_delete(space, index, key)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":150
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, __pyx_v_space, __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":149
 *         buf.encode_request_delete(space, index, key)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":134
 *             buf, timeout)
 * 
 *     cdef object _delete(self, SchemaSpace space, SchemaIndex index, key,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":153
 *             buf, timeout)
 * 
 *     cdef object _update(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                          key, list operations,
 *                          float timeout, bint push_subscribe):
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__update(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_index, PyObject *__pyx_v_key, PyObject *__pyx_v_operations, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_update", 0);

  /* "asynctnt/iproto/db.pyx":162
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_UPDATE             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_UPDATE;

  /* "asynctnt/iproto/db.pyx":163
 * 
 *         op = tarantool.IPROTO_UPDATE
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":164
 *         op = tarantool.IPROTO_UPDATE
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":165
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_update(space, index, key, operations)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":166
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_update(space, index, key, operations)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 166, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":167
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_update(space, index, key, operations)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update(__pyx_v_buf, __pyx_v_space, __pyx_v_index, __pyx_v_key, __pyx_v_operations, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 167, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":168
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_update(space, index, key, operations)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":169
 *         buf.encode_request_update(space, index, key, operations)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":170
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, __pyx_v_space, __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":169
 *         buf.encode_request_update(space, index, key, operations)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":153
 *             buf, timeout)
 * 
 *     cdef object _update(self, SchemaSpace space, SchemaIndex index,             # <<<<<<<<<<<<<<
 *                          key, list operations,
 *                          float timeout, bint push_subscribe):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":173
 *             buf, timeout)
 * 
 *     cdef object _upsert(self, SchemaSpace space, t, list operations,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_operations, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_upsert", 0);

  /* "asynctnt/iproto/db.pyx":181
 *             WriteBuffer buf
 * 
 *         op = tarantool.IPROTO_UPSERT             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_UPSERT;

  /* "asynctnt/iproto/db.pyx":182
 * 
 *         op = tarantool.IPROTO_UPSERT
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":183
 *         op = tarantool.IPROTO_UPSERT
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":184
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_upsert(space, t, operations)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":185
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_upsert(space, t, operations)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 185, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":186
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_upsert(space, t, operations)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         return self._protocol.execute(
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_upsert(__pyx_v_buf, __pyx_v_space, __pyx_v_t, __pyx_v_operations); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 186, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":187
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_upsert(space, t, operations)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":188
 *         buf.encode_request_upsert(space, t, operations)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":189
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, space, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, __pyx_v_space, __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/db.pyx":188
 *         buf.encode_request_upsert(space, t, operations)
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, space, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":173
 *             buf, timeout)
 * 
 *     cdef object _upsert(self, SchemaSpace space, t, list operations,             # <<<<<<<<<<<<<<
 *                          float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._upsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":192
 *             buf, timeout)
 * 
 *     cdef object _sql(self, str query, args, bint parse_metadata,             # <<<<<<<<<<<<<<
 *                       float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args, int __pyx_v_parse_metadata, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_sql", 0);

  /* "asynctnt/iproto/db.pyx":201
 *             Request req
 * 
 *         op = tarantool.IPROTO_EXECUTE             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_EXECUTE;

  /* "asynctnt/iproto/db.pyx":202
 * 
 *         op = tarantool.IPROTO_EXECUTE
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":203
 *         op = tarantool.IPROTO_EXECUTE
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":204
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_sql(query, args)
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":205
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 *         buf.encode_request_sql(query, args)
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 205, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":206
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_sql(query, args)             # <<<<<<<<<<<<<<
 *         buf.write_length()
 *         req = Request.new(op, sync, schema_id, None, push_subscribe)
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_sql(__pyx_v_buf, __pyx_v_query, __pyx_v_args); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 206, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":207
 *         buf.write_header(sync, op, schema_id)
 *         buf.encode_request_sql(query, args)
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         req = Request.new(op, sync, schema_id, None, push_subscribe)
 *         req.parse_metadata = parse_metadata
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":208
 *         buf.encode_request_sql(query, args)
 *         buf.write_length()
 *         req = Request.new(op, sync, schema_id, None, push_subscribe)             # <<<<<<<<<<<<<<
 *         req.parse_metadata = parse_metadata
 *         req.parse_as_tuples = True
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None), __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_req = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":209
 *         buf.write_length()
 *         req = Request.new(op, sync, schema_id, None, push_subscribe)
 *         req.parse_metadata = parse_metadata             # <<<<<<<<<<<<<<
 *         req.parse_as_tuples = True
 *         return self._protocol.execute(req, buf, timeout)
 */
  __pyx_v_req->parse_metadata = __pyx_v_parse_metadata;

  /* "asynctnt/iproto/db.pyx":210
 *         req = Request.new(op, sync, schema_id, None, push_subscribe)
 *         req.parse_metadata = parse_metadata
 *         req.parse_as_tuples = True             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(req, buf, timeout)
 * 
 */
  __pyx_v_req->parse_as_tuples = 1;

  /* "asynctnt/iproto/db.pyx":211
 *         req.parse_metadata = parse_metadata
 *         req.parse_as_tuples = True
 *         return self._protocol.execute(req, buf, timeout)             # <<<<<<<<<<<<<<
 * 
 *     cdef object _auth(self, bytes salt, str username, str password,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, __pyx_v_req, __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":192
 *             buf, timeout)
 * 
 *     cdef object _sql(self, str query, args, bint parse_metadata,             # <<<<<<<<<<<<<<
 *                       float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":213
 *         return self._protocol.execute(req, buf, timeout)
 * 
 *     cdef object _auth(self, bytes salt, str username, str password,             # <<<<<<<<<<<<<<
 *                        float timeout, bint push_subscribe):
 *         cdef:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_salt, PyObject *__pyx_v_username, PyObject *__pyx_v_password, float __pyx_v_timeout, int __pyx_v_push_subscribe) {
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_v_op;
  uint64_t __pyx_v_sync;
  int64_t __pyx_v_schema_id;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_v_username_bytes = 0;
  PyObject *__pyx_v_password_bytes = 0;
  PyObject *__pyx_v_hash1 = 0;
  PyObject *__pyx_v_hash2 = 0;
  PyObject *__pyx_v_scramble = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth", 0);

  /* "asynctnt/iproto/db.pyx":224
 *             bytes hash1, hash2, scramble
 * 
 *         op = tarantool.IPROTO_AUTH             # <<<<<<<<<<<<<<
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 */
  __pyx_v_op = __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_AUTH;

  /* "asynctnt/iproto/db.pyx":225
 * 
 *         op = tarantool.IPROTO_AUTH
 *         sync = self.next_sync()             # <<<<<<<<<<<<<<
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 */
  __pyx_v_sync = __pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync(__pyx_v_self);

  /* "asynctnt/iproto/db.pyx":226
 *         op = tarantool.IPROTO_AUTH
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)
 */
  __pyx_v_schema_id = -1L;

  /* "asynctnt/iproto/db.pyx":227
 *         sync = self.next_sync()
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)             # <<<<<<<<<<<<<<
 *         buf.write_header(sync, op, schema_id)
 * 
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":228
 *         schema_id = -1  # not sending schema_id with the request
 *         buf = WriteBuffer.new(self._encoding)
 *         buf.write_header(sync, op, schema_id)             # <<<<<<<<<<<<<<
 * 
 *         username_bytes = encode_unicode_string(username, self._encoding)
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header(__pyx_v_buf, __pyx_v_sync, __pyx_v_op, __pyx_v_schema_id); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 228, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":230
 *         buf.write_header(sync, op, schema_id)
 * 
 *         username_bytes = encode_unicode_string(username, self._encoding)             # <<<<<<<<<<<<<<
 *         password_bytes = encode_unicode_string(password, self._encoding)
 * 
 */
  __pyx_t_2 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_username, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_username_bytes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":231
 * 
 *         username_bytes = encode_unicode_string(username, self._encoding)
 *         password_bytes = encode_unicode_string(password, self._encoding)             # <<<<<<<<<<<<<<
 * 
 *         hash1 = Db._sha1((password_bytes,))
 */
  __pyx_t_1 = __pyx_v_self->_encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string(__pyx_v_password, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_password_bytes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":233
 *         password_bytes = encode_unicode_string(password, self._encoding)
 * 
 *         hash1 = Db._sha1((password_bytes,))             # <<<<<<<<<<<<<<
 *         hash2 = Db._sha1((hash1,))
 *         scramble = Db._sha1((salt, hash2))
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_password_bytes);
  __Pyx_GIVEREF(__pyx_v_password_bytes);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_password_bytes);
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_2Db__sha1(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hash1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":234
 * 
 *         hash1 = Db._sha1((password_bytes,))
 *         hash2 = Db._sha1((hash1,))             # <<<<<<<<<<<<<<
 *         scramble = Db._sha1((salt, hash2))
 *         scramble = Db._strxor(hash1, scramble)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_hash1);
  __Pyx_GIVEREF(__pyx_v_hash1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hash1);
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_2Db__sha1(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_hash2 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":235
 *         hash1 = Db._sha1((password_bytes,))
 *         hash2 = Db._sha1((hash1,))
 *         scramble = Db._sha1((salt, hash2))             # <<<<<<<<<<<<<<
 *         scramble = Db._strxor(hash1, scramble)
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_salt);
  __Pyx_GIVEREF(__pyx_v_salt);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_salt);
  __Pyx_INCREF(__pyx_v_hash2);
  __Pyx_GIVEREF(__pyx_v_hash2);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_hash2);
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_2Db__sha1(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_scramble = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":236
 *         hash2 = Db._sha1((hash1,))
 *         scramble = Db._sha1((salt, hash2))
 *         scramble = Db._strxor(hash1, scramble)             # <<<<<<<<<<<<<<
 * 
 *         buf.encode_request_auth(username_bytes, scramble)
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_2Db__strxor(__pyx_v_hash1, __pyx_v_scramble); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_scramble, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":238
 *         scramble = Db._strxor(hash1, scramble)
 * 
 *         buf.encode_request_auth(username_bytes, scramble)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_length()
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_auth(__pyx_v_buf, __pyx_v_username_bytes, __pyx_v_scramble); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 238, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":240
 *         buf.encode_request_auth(username_bytes, scramble)
 * 
 *         buf.write_length()             # <<<<<<<<<<<<<<
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 */
  __pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length(__pyx_v_buf);

  /* "asynctnt/iproto/db.pyx":241
 * 
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "asynctnt/iproto/db.pyx":242
 *         buf.write_length()
 *         return self._protocol.execute(
 *             Request.new(op, sync, schema_id, None, push_subscribe),             # <<<<<<<<<<<<<<
 *             buf, timeout)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_7Request_new(__pyx_v_op, __pyx_v_sync, __pyx_v_schema_id, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None), __pyx_v_push_subscribe)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "asynctnt/iproto/db.pyx":241
 * 
 *         buf.write_length()
 *         return self._protocol.execute(             # <<<<<<<<<<<<<<
 *             Request.new(op, sync, schema_id, None, push_subscribe),
 *             buf, timeout)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->execute(__pyx_v_self->_protocol, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_1), __pyx_v_buf, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":213
 *         return self._protocol.execute(req, buf, timeout)
 * 
 *     cdef object _auth(self, bytes salt, str username, str password,             # <<<<<<<<<<<<<<
 *                        float timeout, bint push_subscribe):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._auth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_username_bytes);
  __Pyx_XDECREF(__pyx_v_password_bytes);
  __Pyx_XDECREF(__pyx_v_hash1);
  __Pyx_XDECREF(__pyx_v_hash2);
  __Pyx_XDECREF(__pyx_v_scramble);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":246
 * 
 *     @staticmethod
 *     cdef bytes _sha1(tuple values):             # <<<<<<<<<<<<<<
 *         cdef object sha = hashlib.sha1()
 *         for i in values:
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__sha1(PyObject *__pyx_v_values) {
  PyObject *__pyx_v_sha = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_sha1", 0);

  /* "asynctnt/iproto/db.pyx":247
 *     @staticmethod
 *     cdef bytes _sha1(tuple values):
 *         cdef object sha = hashlib.sha1()             # <<<<<<<<<<<<<<
 *         for i in values:
 *             if i is not None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sha1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sha = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":248
 *     cdef bytes _sha1(tuple values):
 *         cdef object sha = hashlib.sha1()
 *         for i in values:             # <<<<<<<<<<<<<<
 *             if i is not None:
 *                 sha.update(i)
 */
  if (unlikely(__pyx_v_values == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(9, 248, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 248, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asynctnt/iproto/db.pyx":249
 *         cdef object sha = hashlib.sha1()
 *         for i in values:
 *             if i is not None:             # <<<<<<<<<<<<<<
 *                 sha.update(i)
 *         return sha.digest()
 */
    __pyx_t_5 = (__pyx_v_i != Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "asynctnt/iproto/db.pyx":250
 *         for i in values:
 *             if i is not None:
 *                 sha.update(i)             # <<<<<<<<<<<<<<
 *         return sha.digest()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sha, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && 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);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asynctnt/iproto/db.pyx":249
 *         cdef object sha = hashlib.sha1()
 *         for i in values:
 *             if i is not None:             # <<<<<<<<<<<<<<
 *                 sha.update(i)
 *         return sha.digest()
 */
    }

    /* "asynctnt/iproto/db.pyx":248
 *     cdef bytes _sha1(tuple values):
 *         cdef object sha = hashlib.sha1()
 *         for i in values:             # <<<<<<<<<<<<<<
 *             if i is not None:
 *                 sha.update(i)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":251
 *             if i is not None:
 *                 sha.update(i)
 *         return sha.digest()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sha, __pyx_n_s_digest); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(9, 251, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":246
 * 
 *     @staticmethod
 *     cdef bytes _sha1(tuple values):             # <<<<<<<<<<<<<<
 *         cdef object sha = hashlib.sha1()
 *         for i in values:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._sha1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sha);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":254
 * 
 *     @staticmethod
 *     cdef bytes _strxor(bytes hash1, bytes scramble):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *hash1_str
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_2Db__strxor(PyObject *__pyx_v_hash1, PyObject *__pyx_v_scramble) {
  char *__pyx_v_hash1_str;
  Py_ssize_t __pyx_v_hash1_len;
  char *__pyx_v_scramble_str;
  Py_ssize_t __pyx_v_scramble_len;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_strxor", 0);

  /* "asynctnt/iproto/db.pyx":261
 *             char *scramble_str
 *             ssize_t scramble_len
 *         cpython.bytes.PyBytes_AsStringAndSize(hash1,             # <<<<<<<<<<<<<<
 *                                               &hash1_str, &hash1_len)
 *         cpython.bytes.PyBytes_AsStringAndSize(scramble,
 */
  __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_hash1, (&__pyx_v_hash1_str), ((Py_ssize_t *)(&__pyx_v_hash1_len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 261, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":263
 *         cpython.bytes.PyBytes_AsStringAndSize(hash1,
 *                                               &hash1_str, &hash1_len)
 *         cpython.bytes.PyBytes_AsStringAndSize(scramble,             # <<<<<<<<<<<<<<
 *                                               &scramble_str, &scramble_len)
 *         for i in range(scramble_len):
 */
  __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_scramble, (&__pyx_v_scramble_str), ((Py_ssize_t *)(&__pyx_v_scramble_len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 263, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":265
 *         cpython.bytes.PyBytes_AsStringAndSize(scramble,
 *                                               &scramble_str, &scramble_len)
 *         for i in range(scramble_len):             # <<<<<<<<<<<<<<
 *             scramble_str[i] = hash1_str[i] ^ scramble_str[i]
 *         return scramble
 */
  __pyx_t_2 = __pyx_v_scramble_len;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "asynctnt/iproto/db.pyx":266
 *                                               &scramble_str, &scramble_len)
 *         for i in range(scramble_len):
 *             scramble_str[i] = hash1_str[i] ^ scramble_str[i]             # <<<<<<<<<<<<<<
 *         return scramble
 * 
 */
    (__pyx_v_scramble_str[__pyx_v_i]) = ((__pyx_v_hash1_str[__pyx_v_i]) ^ (__pyx_v_scramble_str[__pyx_v_i]));
  }

  /* "asynctnt/iproto/db.pyx":267
 *         for i in range(scramble_len):
 *             scramble_str[i] = hash1_str[i] ^ scramble_str[i]
 *         return scramble             # <<<<<<<<<<<<<<
 * 
 *     # public methods
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_scramble);
  __pyx_r = __pyx_v_scramble;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":254
 * 
 *     @staticmethod
 *     cdef bytes _strxor(bytes hash1, bytes scramble):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char *hash1_str
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db._strxor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":271
 *     # public methods
 * 
 *     def ping(self, timeout=-1):             # <<<<<<<<<<<<<<
 *         return self._ping(timeout, False)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_3ping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_3ping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ping (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_neg_1);
    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);
        CYTHON_FALLTHROUGH;
        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 = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ping") < 0)) __PYX_ERR(9, 271, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_timeout = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ping", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 271, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_2ping(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_2ping(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ping", 0);

  /* "asynctnt/iproto/db.pyx":272
 * 
 *     def ping(self, timeout=-1):
 *         return self._ping(timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def call16(self, func_name, args=None, timeout=-1, push_subscribe=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 272, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_ping(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":271
 *     # public methods
 * 
 *     def ping(self, timeout=-1):             # <<<<<<<<<<<<<<
 *         return self._ping(timeout, False)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":274
 *         return self._ping(timeout, False)
 * 
 *     def call16(self, func_name, args=None, timeout=-1, push_subscribe=False):             # <<<<<<<<<<<<<<
 *         return self._call16(func_name, args, timeout, push_subscribe)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_5call16(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_5call16(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func_name = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_push_subscribe = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call16 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func_name,&__pyx_n_s_args,&__pyx_n_s_timeout,&__pyx_n_s_push_subscribe,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_neg_1);
    values[3] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_push_subscribe);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call16") < 0)) __PYX_ERR(9, 274, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_func_name = values[0];
    __pyx_v_args = values[1];
    __pyx_v_timeout = values[2];
    __pyx_v_push_subscribe = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call16", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 274, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.call16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_4call16(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_func_name, __pyx_v_args, __pyx_v_timeout, __pyx_v_push_subscribe);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_4call16(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, PyObject *__pyx_v_timeout, PyObject *__pyx_v_push_subscribe) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call16", 0);

  /* "asynctnt/iproto/db.pyx":275
 * 
 *     def call16(self, func_name, args=None, timeout=-1, push_subscribe=False):
 *         return self._call16(func_name, args, timeout, push_subscribe)             # <<<<<<<<<<<<<<
 * 
 *     def call(self, func_name, args=None, timeout=-1, push_subscribe=False):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_func_name))||((__pyx_v_func_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_func_name)->tp_name), 0))) __PYX_ERR(9, 275, __pyx_L1_error)
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 275, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_push_subscribe); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 275, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_call16(__pyx_v_self, ((PyObject*)__pyx_v_func_name), __pyx_v_args, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":274
 *         return self._ping(timeout, False)
 * 
 *     def call16(self, func_name, args=None, timeout=-1, push_subscribe=False):             # <<<<<<<<<<<<<<
 *         return self._call16(func_name, args, timeout, push_subscribe)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.call16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":277
 *         return self._call16(func_name, args, timeout, push_subscribe)
 * 
 *     def call(self, func_name, args=None, timeout=-1, push_subscribe=False):             # <<<<<<<<<<<<<<
 *         return self._call(func_name, args, timeout, push_subscribe)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_7call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_7call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func_name = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_push_subscribe = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func_name,&__pyx_n_s_args,&__pyx_n_s_timeout,&__pyx_n_s_push_subscribe,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_neg_1);
    values[3] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_push_subscribe);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call") < 0)) __PYX_ERR(9, 277, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_func_name = values[0];
    __pyx_v_args = values[1];
    __pyx_v_timeout = values[2];
    __pyx_v_push_subscribe = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 277, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_6call(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_func_name, __pyx_v_args, __pyx_v_timeout, __pyx_v_push_subscribe);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_6call(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_func_name, PyObject *__pyx_v_args, PyObject *__pyx_v_timeout, PyObject *__pyx_v_push_subscribe) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call", 0);

  /* "asynctnt/iproto/db.pyx":278
 * 
 *     def call(self, func_name, args=None, timeout=-1, push_subscribe=False):
 *         return self._call(func_name, args, timeout, push_subscribe)             # <<<<<<<<<<<<<<
 * 
 *     def eval(self, expression, args=None, timeout=-1, push_subscribe=False):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_func_name))||((__pyx_v_func_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_func_name)->tp_name), 0))) __PYX_ERR(9, 278, __pyx_L1_error)
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 278, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_push_subscribe); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 278, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_call(__pyx_v_self, ((PyObject*)__pyx_v_func_name), __pyx_v_args, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":277
 *         return self._call16(func_name, args, timeout, push_subscribe)
 * 
 *     def call(self, func_name, args=None, timeout=-1, push_subscribe=False):             # <<<<<<<<<<<<<<
 *         return self._call(func_name, args, timeout, push_subscribe)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":280
 *         return self._call(func_name, args, timeout, push_subscribe)
 * 
 *     def eval(self, expression, args=None, timeout=-1, push_subscribe=False):             # <<<<<<<<<<<<<<
 *         return self._eval(expression, args, timeout, push_subscribe)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_9eval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_9eval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_expression = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_push_subscribe = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("eval (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_expression,&__pyx_n_s_args,&__pyx_n_s_timeout,&__pyx_n_s_push_subscribe,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_neg_1);
    values[3] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_expression)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_push_subscribe);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eval") < 0)) __PYX_ERR(9, 280, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_expression = values[0];
    __pyx_v_args = values[1];
    __pyx_v_timeout = values[2];
    __pyx_v_push_subscribe = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("eval", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 280, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_8eval(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_expression, __pyx_v_args, __pyx_v_timeout, __pyx_v_push_subscribe);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_8eval(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_expression, PyObject *__pyx_v_args, PyObject *__pyx_v_timeout, PyObject *__pyx_v_push_subscribe) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("eval", 0);

  /* "asynctnt/iproto/db.pyx":281
 * 
 *     def eval(self, expression, args=None, timeout=-1, push_subscribe=False):
 *         return self._eval(expression, args, timeout, push_subscribe)             # <<<<<<<<<<<<<<
 * 
 *     def select(self, space, key=None,
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_expression))||((__pyx_v_expression) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_expression)->tp_name), 0))) __PYX_ERR(9, 281, __pyx_L1_error)
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 281, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_push_subscribe); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 281, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_eval(__pyx_v_self, ((PyObject*)__pyx_v_expression), __pyx_v_args, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":280
 *         return self._call(func_name, args, timeout, push_subscribe)
 * 
 *     def eval(self, expression, args=None, timeout=-1, push_subscribe=False):             # <<<<<<<<<<<<<<
 *         return self._eval(expression, args, timeout, push_subscribe)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":283
 *         return self._eval(expression, args, timeout, push_subscribe)
 * 
 *     def select(self, space, key=None,             # <<<<<<<<<<<<<<
 *                offset=0, limit=0xffffffff, index=0, iterator=0,
 *                timeout=-1):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_11select(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_11select(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_iterator = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space,&__pyx_n_s_key,&__pyx_n_s_offset,&__pyx_n_s_limit,&__pyx_n_s_index,&__pyx_n_s_iterator,&__pyx_n_s_timeout,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_4294967295);
    values[4] = ((PyObject *)__pyx_int_0);
    values[5] = ((PyObject *)__pyx_int_0);
    values[6] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterator);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select") < 0)) __PYX_ERR(9, 283, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_space = values[0];
    __pyx_v_key = values[1];
    __pyx_v_offset = values[2];
    __pyx_v_limit = values[3];
    __pyx_v_index = values[4];
    __pyx_v_iterator = values[5];
    __pyx_v_timeout = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("select", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 283, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_10select(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_offset, __pyx_v_limit, __pyx_v_index, __pyx_v_iterator, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_10select(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_offset, PyObject *__pyx_v_limit, PyObject *__pyx_v_index, PyObject *__pyx_v_iterator, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint32_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  uint64_t __pyx_t_6;
  uint64_t __pyx_t_7;
  float __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("select", 0);
  __Pyx_INCREF(__pyx_v_iterator);

  /* "asynctnt/iproto/db.pyx":289
 *             SchemaSpace sp
 *             SchemaIndex idx
 *         sp = self._protocol._schema.get_or_create_space(space)             # <<<<<<<<<<<<<<
 *         idx = sp.get_index(index)
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->_protocol->_schema->__pyx_vtab)->get_or_create_space(__pyx_v_self->_protocol->_schema, __pyx_v_space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":290
 *             SchemaIndex idx
 *         sp = self._protocol._schema.get_or_create_space(space)
 *         idx = sp.get_index(index)             # <<<<<<<<<<<<<<
 * 
 *         iterator = self._protocol.transform_iterator(iterator)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_sp->__pyx_vtab)->get_index(__pyx_v_sp, __pyx_v_index, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_idx = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":292
 *         idx = sp.get_index(index)
 * 
 *         iterator = self._protocol.transform_iterator(iterator)             # <<<<<<<<<<<<<<
 *         if key is None and iterator == 0:
 *             iterator = 2  # ALL
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->_protocol->__pyx_base.__pyx_vtab)->transform_iterator(__pyx_v_self->_protocol, __pyx_v_iterator); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 292, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_iterator, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":293
 * 
 *         iterator = self._protocol.transform_iterator(iterator)
 *         if key is None and iterator == 0:             # <<<<<<<<<<<<<<
 *             iterator = 2  # ALL
 * 
 */
  __pyx_t_4 = (__pyx_v_key == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_iterator, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "asynctnt/iproto/db.pyx":294
 *         iterator = self._protocol.transform_iterator(iterator)
 *         if key is None and iterator == 0:
 *             iterator = 2  # ALL             # <<<<<<<<<<<<<<
 * 
 *         return self._select(sp, idx, key, offset, limit, iterator,
 */
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_DECREF_SET(__pyx_v_iterator, __pyx_int_2);

    /* "asynctnt/iproto/db.pyx":293
 * 
 *         iterator = self._protocol.transform_iterator(iterator)
 *         if key is None and iterator == 0:             # <<<<<<<<<<<<<<
 *             iterator = 2  # ALL
 * 
 */
  }

  /* "asynctnt/iproto/db.pyx":296
 *             iterator = 2  # ALL
 * 
 *         return self._select(sp, idx, key, offset, limit, iterator,             # <<<<<<<<<<<<<<
 *                             timeout, False)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyInt_As_uint64_t(__pyx_v_offset); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 296, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_limit); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 296, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_As_uint32_t(__pyx_v_iterator); if (unlikely((__pyx_t_2 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 296, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":297
 * 
 *         return self._select(sp, idx, key, offset, limit, iterator,
 *                             timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def insert(self, space, t, replace=False,
 */
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 297, __pyx_L1_error)

  /* "asynctnt/iproto/db.pyx":296
 *             iterator = 2  # ALL
 * 
 *         return self._select(sp, idx, key, offset, limit, iterator,             # <<<<<<<<<<<<<<
 *                             timeout, False)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_select(__pyx_v_self, __pyx_v_sp, __pyx_v_idx, __pyx_v_key, __pyx_t_6, __pyx_t_7, __pyx_t_2, __pyx_t_8, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":283
 *         return self._eval(expression, args, timeout, push_subscribe)
 * 
 *     def select(self, space, key=None,             # <<<<<<<<<<<<<<
 *                offset=0, limit=0xffffffff, index=0, iterator=0,
 *                timeout=-1):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_iterator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":299
 *                             timeout, False)
 * 
 *     def insert(self, space, t, replace=False,             # <<<<<<<<<<<<<<
 *                timeout=-1):
 *         cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_13insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_13insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_v_replace = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space,&__pyx_n_s_t,&__pyx_n_s_replace,&__pyx_n_s_timeout,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 4, 1); __PYX_ERR(9, 299, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replace);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(9, 299, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_space = values[0];
    __pyx_v_t = values[1];
    __pyx_v_replace = values[2];
    __pyx_v_timeout = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 299, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_12insert(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_space, __pyx_v_t, __pyx_v_replace, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_12insert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_replace, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  float __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insert", 0);

  /* "asynctnt/iproto/db.pyx":303
 *         cdef:
 *             SchemaSpace sp
 *         sp = self._protocol._schema.get_or_create_space(space)             # <<<<<<<<<<<<<<
 * 
 *         return self._insert(sp, t, replace, timeout, False)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->_protocol->_schema->__pyx_vtab)->get_or_create_space(__pyx_v_self->_protocol->_schema, __pyx_v_space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":305
 *         sp = self._protocol._schema.get_or_create_space(space)
 * 
 *         return self._insert(sp, t, replace, timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def replace(self, space, t, timeout=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_replace); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 305, __pyx_L1_error)
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 305, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_sp, __pyx_v_t, __pyx_t_2, __pyx_t_3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":299
 *                             timeout, False)
 * 
 *     def insert(self, space, t, replace=False,             # <<<<<<<<<<<<<<
 *                timeout=-1):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":307
 *         return self._insert(sp, t, replace, timeout, False)
 * 
 *     def replace(self, space, t, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_15replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_15replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space,&__pyx_n_s_t,&__pyx_n_s_timeout,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("replace", 0, 2, 3, 1); __PYX_ERR(9, 307, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(9, 307, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_space = values[0];
    __pyx_v_t = values[1];
    __pyx_v_timeout = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 307, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_14replace(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_space, __pyx_v_t, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_14replace(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace", 0);

  /* "asynctnt/iproto/db.pyx":310
 *         cdef:
 *             SchemaSpace sp
 *         sp = self._protocol._schema.get_or_create_space(space)             # <<<<<<<<<<<<<<
 * 
 *         return self._insert(sp, t, True, timeout, False)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->_protocol->_schema->__pyx_vtab)->get_or_create_space(__pyx_v_self->_protocol->_schema, __pyx_v_space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":312
 *         sp = self._protocol._schema.get_or_create_space(space)
 * 
 *         return self._insert(sp, t, True, timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, space, key, index=0, timeout=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 312, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_sp, __pyx_v_t, 1, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":307
 *         return self._insert(sp, t, replace, timeout, False)
 * 
 *     def replace(self, space, t, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":314
 *         return self._insert(sp, t, True, timeout, False)
 * 
 *     def delete(self, space, key, index=0, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_17delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_17delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space,&__pyx_n_s_key,&__pyx_n_s_index,&__pyx_n_s_timeout,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delete", 0, 2, 4, 1); __PYX_ERR(9, 314, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(9, 314, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_space = values[0];
    __pyx_v_key = values[1];
    __pyx_v_index = values[2];
    __pyx_v_timeout = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 314, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_16delete(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_index, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_16delete(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_index, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "asynctnt/iproto/db.pyx":318
 *             SchemaSpace sp
 *             SchemaIndex idx
 *         sp = self._protocol._schema.get_or_create_space(space)             # <<<<<<<<<<<<<<
 *         idx = sp.get_index(index)
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->_protocol->_schema->__pyx_vtab)->get_or_create_space(__pyx_v_self->_protocol->_schema, __pyx_v_space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":319
 *             SchemaIndex idx
 *         sp = self._protocol._schema.get_or_create_space(space)
 *         idx = sp.get_index(index)             # <<<<<<<<<<<<<<
 * 
 *         return self._delete(sp, idx, key, timeout, False)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_sp->__pyx_vtab)->get_index(__pyx_v_sp, __pyx_v_index, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_idx = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":321
 *         idx = sp.get_index(index)
 * 
 *         return self._delete(sp, idx, key, timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def update(self, space, key, operations, index=0, timeout=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 321, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_delete(__pyx_v_self, __pyx_v_sp, __pyx_v_idx, __pyx_v_key, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":314
 *         return self._insert(sp, t, True, timeout, False)
 * 
 *     def delete(self, space, key, index=0, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":323
 *         return self._delete(sp, idx, key, timeout, False)
 * 
 *     def update(self, space, key, operations, index=0, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_19update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_19update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_operations = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space,&__pyx_n_s_key,&__pyx_n_s_operations,&__pyx_n_s_index,&__pyx_n_s_timeout,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_0);
    values[4] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update", 0, 3, 5, 1); __PYX_ERR(9, 323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operations)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update", 0, 3, 5, 2); __PYX_ERR(9, 323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(9, 323, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 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_space = values[0];
    __pyx_v_key = values[1];
    __pyx_v_operations = values[2];
    __pyx_v_index = values[3];
    __pyx_v_timeout = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 323, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_18update(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_operations, __pyx_v_index, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_18update(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_operations, PyObject *__pyx_v_index, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *__pyx_v_idx = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("update", 0);

  /* "asynctnt/iproto/db.pyx":327
 *             SchemaSpace sp
 *             SchemaIndex idx
 *         sp = self._protocol._schema.get_or_create_space(space)             # <<<<<<<<<<<<<<
 *         idx = sp.get_index(index)
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->_protocol->_schema->__pyx_vtab)->get_or_create_space(__pyx_v_self->_protocol->_schema, __pyx_v_space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":328
 *             SchemaIndex idx
 *         sp = self._protocol._schema.get_or_create_space(space)
 *         idx = sp.get_index(index)             # <<<<<<<<<<<<<<
 * 
 *         return self._update(sp, idx, key, operations, timeout, False)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_v_sp->__pyx_vtab)->get_index(__pyx_v_sp, __pyx_v_index, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_idx = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":330
 *         idx = sp.get_index(index)
 * 
 *         return self._update(sp, idx, key, operations, timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def upsert(self, space, t, operations, timeout=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyList_CheckExact(__pyx_v_operations))||((__pyx_v_operations) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_operations)->tp_name), 0))) __PYX_ERR(9, 330, __pyx_L1_error)
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 330, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_update(__pyx_v_self, __pyx_v_sp, __pyx_v_idx, __pyx_v_key, ((PyObject*)__pyx_v_operations), __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":323
 *         return self._delete(sp, idx, key, timeout, False)
 * 
 *     def update(self, space, key, operations, index=0, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":332
 *         return self._update(sp, idx, key, operations, timeout, False)
 * 
 *     def upsert(self, space, t, operations, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_21upsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_21upsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_space = 0;
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_v_operations = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space,&__pyx_n_s_t,&__pyx_n_s_operations,&__pyx_n_s_timeout,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("upsert", 0, 3, 4, 1); __PYX_ERR(9, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operations)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("upsert", 0, 3, 4, 2); __PYX_ERR(9, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "upsert") < 0)) __PYX_ERR(9, 332, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 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_space = values[0];
    __pyx_v_t = values[1];
    __pyx_v_operations = values[2];
    __pyx_v_timeout = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upsert", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 332, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.upsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_20upsert(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_space, __pyx_v_t, __pyx_v_operations, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_20upsert(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_t, PyObject *__pyx_v_operations, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *__pyx_v_sp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("upsert", 0);

  /* "asynctnt/iproto/db.pyx":335
 *         cdef:
 *             SchemaSpace sp
 *         sp = self._protocol._schema.get_or_create_space(space)             # <<<<<<<<<<<<<<
 * 
 *         return self._upsert(sp, t, operations, timeout, False)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema *)__pyx_v_self->_protocol->_schema->__pyx_vtab)->get_or_create_space(__pyx_v_self->_protocol->_schema, __pyx_v_space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sp = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/db.pyx":337
 *         sp = self._protocol._schema.get_or_create_space(space)
 * 
 *         return self._upsert(sp, t, operations, timeout, False)             # <<<<<<<<<<<<<<
 * 
 *     def sql(self, query, args, parse_metadata=True, timeout=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyList_CheckExact(__pyx_v_operations))||((__pyx_v_operations) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_operations)->tp_name), 0))) __PYX_ERR(9, 337, __pyx_L1_error)
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 337, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_upsert(__pyx_v_self, __pyx_v_sp, __pyx_v_t, ((PyObject*)__pyx_v_operations), __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":332
 *         return self._update(sp, idx, key, operations, timeout, False)
 * 
 *     def upsert(self, space, t, operations, timeout=-1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SchemaSpace sp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.upsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/db.pyx":339
 *         return self._upsert(sp, t, operations, timeout, False)
 * 
 *     def sql(self, query, args, parse_metadata=True, timeout=-1):             # <<<<<<<<<<<<<<
 *         return self._sql(query, args, parse_metadata, timeout, False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_23sql(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_23sql(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_parse_metadata = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sql (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_args,&__pyx_n_s_parse_metadata,&__pyx_n_s_timeout,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sql", 0, 2, 4, 1); __PYX_ERR(9, 339, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parse_metadata);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sql") < 0)) __PYX_ERR(9, 339, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_query = values[0];
    __pyx_v_args = values[1];
    __pyx_v_parse_metadata = values[2];
    __pyx_v_timeout = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sql", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 339, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_22sql(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), __pyx_v_query, __pyx_v_args, __pyx_v_parse_metadata, __pyx_v_timeout);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_22sql(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args, PyObject *__pyx_v_parse_metadata, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  float __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sql", 0);

  /* "asynctnt/iproto/db.pyx":340
 * 
 *     def sql(self, query, args, parse_metadata=True, timeout=-1):
 *         return self._sql(query, args, parse_metadata, timeout, False)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyUnicode_CheckExact(__pyx_v_query))||((__pyx_v_query) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_query)->tp_name), 0))) __PYX_ERR(9, 340, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_parse_metadata); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 340, __pyx_L1_error)
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(9, 340, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self->__pyx_vtab)->_sql(__pyx_v_self, ((PyObject*)__pyx_v_query), __pyx_v_args, __pyx_t_1, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/db.pyx":339
 *         return self._upsert(sp, t, operations, timeout, False)
 * 
 *     def sql(self, query, args, parse_metadata=True, timeout=-1):             # <<<<<<<<<<<<<<
 *         return self._sql(query, args, parse_metadata, timeout, False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_24__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_2Db_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2Db_26__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2Db_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.Db.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/push.pyx":8
 * 
 * cdef class PushIterator:
 *     def __init__(self, fut: asyncio.Future):             # <<<<<<<<<<<<<<
 *         """
 *             Creates PushIterator object. In order to receive push notifications
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8asynctnt_6iproto_8protocol_12PushIterator___init__[] = "\n            Creates PushIterator object. In order to receive push notifications\n            this iterator must be created.\n\n            Example:\n\n            .. code-block:: pycon\n\n                # tarantool function:\n                # function f()\n                #     box.session.push('hello')\n                #     return 'finished'\n                # end\n\n                >>> fut = conn.call('async_function', push_subscribe=True)\n                >>> async for item in PushIterator(fut):\n                ...     print(item)\n\n\n            :param fut: Future object returned from call_async, eval_sync\n                        functions\n            :type fut: asyncio.Future\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_8asynctnt_6iproto_8protocol_12PushIterator___init__;
#endif
static int __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fut = 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_fut,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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fut)) != 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_ERR(4, 8, __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_fut = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 8, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator___init__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self), __pyx_v_fut);

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator___init__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self, PyObject *__pyx_v_fut) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_request = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  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("__init__", 0);

  /* "asynctnt/iproto/push.pyx":34
 *         cdef:
 *             Request request
 *         if not hasattr(fut, '_req'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Future is invalid. Make sure to call with '
 *                              'a future returned from a method with '
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_fut, __pyx_n_u_req); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 34, __pyx_L1_error)
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "asynctnt/iproto/push.pyx":35
 *             Request request
 *         if not hasattr(fut, '_req'):
 *             raise ValueError('Future is invalid. Make sure to call with '             # <<<<<<<<<<<<<<
 *                              'a future returned from a method with '
 *                              'push_subscribe=True flag')
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 35, __pyx_L1_error)

    /* "asynctnt/iproto/push.pyx":34
 *         cdef:
 *             Request request
 *         if not hasattr(fut, '_req'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Future is invalid. Make sure to call with '
 *                              'a future returned from a method with '
 */
  }

  /* "asynctnt/iproto/push.pyx":39
 *                              'push_subscribe=True flag')
 * 
 *         request = <Request>fut._req             # <<<<<<<<<<<<<<
 * 
 *         if not request.push_subscribe:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_req); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_request = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asynctnt/iproto/push.pyx":41
 *         request = <Request>fut._req
 * 
 *         if not request.push_subscribe:             # <<<<<<<<<<<<<<
 *             raise ValueError('Future is invalid. Make sure to call with '
 *                              'a future returned from a method with '
 */
  __pyx_t_2 = ((!(__pyx_v_request->push_subscribe != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "asynctnt/iproto/push.pyx":42
 * 
 *         if not request.push_subscribe:
 *             raise ValueError('Future is invalid. Make sure to call with '             # <<<<<<<<<<<<<<
 *                              'a future returned from a method with '
 *                              'push_subscribe=True flag')
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(4, 42, __pyx_L1_error)

    /* "asynctnt/iproto/push.pyx":41
 *         request = <Request>fut._req
 * 
 *         if not request.push_subscribe:             # <<<<<<<<<<<<<<
 *             raise ValueError('Future is invalid. Make sure to call with '
 *                              'a future returned from a method with '
 */
  }

  /* "asynctnt/iproto/push.pyx":46
 *                              'push_subscribe=True flag')
 * 
 *         self._fut = fut             # <<<<<<<<<<<<<<
 *         self._request = request
 *         self._response = request.response
 */
  __Pyx_INCREF(__pyx_v_fut);
  __Pyx_GIVEREF(__pyx_v_fut);
  __Pyx_GOTREF(__pyx_v_self->_fut);
  __Pyx_DECREF(__pyx_v_self->_fut);
  __pyx_v_self->_fut = __pyx_v_fut;

  /* "asynctnt/iproto/push.pyx":47
 * 
 *         self._fut = fut
 *         self._request = request             # <<<<<<<<<<<<<<
 *         self._response = request.response
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_request));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_request));
  __Pyx_GOTREF(__pyx_v_self->_request);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_request));
  __pyx_v_self->_request = __pyx_v_request;

  /* "asynctnt/iproto/push.pyx":48
 *         self._fut = fut
 *         self._request = request
 *         self._response = request.response             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_request->response);
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_response);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_response));
  __pyx_v_self->_response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asynctnt/iproto/push.pyx":8
 * 
 * cdef class PushIterator:
 *     def __init__(self, fut: asyncio.Future):             # <<<<<<<<<<<<<<
 *         """
 *             Creates PushIterator object. In order to receive push notifications
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_request);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/push.pyx":50
 *         self._response = request.response
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Cannot use iter with PushIterator - use aiter')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_2__iter__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_2__iter__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "asynctnt/iproto/push.pyx":51
 * 
 *     def __iter__(self):
 *         raise RuntimeError('Cannot use iter with PushIterator - use aiter')             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 51, __pyx_L1_error)

  /* "asynctnt/iproto/push.pyx":50
 *         self._response = request.response
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Cannot use iter with PushIterator - use aiter')
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/push.pyx":53
 *         raise RuntimeError('Cannot use iter with PushIterator - use aiter')
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Cannot use next with PushIterator - use anext')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_4__next__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_4__next__(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "asynctnt/iproto/push.pyx":54
 * 
 *     def __next__(self):
 *         raise RuntimeError('Cannot use next with PushIterator - use anext')             # <<<<<<<<<<<<<<
 * 
 *     def __aiter__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 54, __pyx_L1_error)

  /* "asynctnt/iproto/push.pyx":53
 *         raise RuntimeError('Cannot use iter with PushIterator - use aiter')
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Cannot use next with PushIterator - use anext')
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/push.pyx":56
 *         raise RuntimeError('Cannot use next with PushIterator - use anext')
 * 
 *     def __aiter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_7__aiter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_7__aiter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__aiter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_6__aiter__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_6__aiter__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__aiter__", 0);

  /* "asynctnt/iproto/push.pyx":57
 * 
 *     def __aiter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @cython.iterable_coroutine
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "asynctnt/iproto/push.pyx":56
 *         raise RuntimeError('Cannot use next with PushIterator - use anext')
 * 
 *     def __aiter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8asynctnt_6iproto_8protocol_12PushIterator_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asynctnt/iproto/push.pyx":60
 * 
 *     @cython.iterable_coroutine
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         cdef Response response
 *         response = self._response
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_9__anext__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_9__anext__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__anext__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_8__anext__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_8__anext__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__anext__", 0);
  __pyx_cur_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *)__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__(__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 60, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_8asynctnt_6iproto_8protocol_12PushIterator_10generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_anext, __pyx_n_s_PushIterator___anext, __pyx_n_s_asynctnt_iproto_protocol); if (unlikely(!gen)) __PYX_ERR(4, 60, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__anext__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8asynctnt_6iproto_8protocol_12PushIterator_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *__pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__anext__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_await;
    case 2: goto __pyx_L10_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 60, __pyx_L1_error)

  /* "asynctnt/iproto/push.pyx":62
 *     async def __anext__(self):
 *         cdef Response response
 *         response = self._response             # <<<<<<<<<<<<<<
 * 
 *         if response.push_len() == 0 and response._code >= 0:
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->_response);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/push.pyx":64
 *         response = self._response
 * 
 *         if response.push_len() == 0 and response._code >= 0:             # <<<<<<<<<<<<<<
 *             # no more data left
 *             raise StopAsyncIteration
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len(__pyx_cur_scope->__pyx_v_response); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_cur_scope->__pyx_v_response->_code >= 0) != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "asynctnt/iproto/push.pyx":66
 *         if response.push_len() == 0 and response._code >= 0:
 *             # no more data left
 *             raise StopAsyncIteration             # <<<<<<<<<<<<<<
 * 
 *         if response.push_len() > 0:
 */
    __Pyx_Raise(((PyObject *)(&((PyTypeObject*)__Pyx_PyExc_StopAsyncIteration)[0])), 0, 0, 0);
    __PYX_ERR(4, 66, __pyx_L1_error)

    /* "asynctnt/iproto/push.pyx":64
 *         response = self._response
 * 
 *         if response.push_len() == 0 and response._code >= 0:             # <<<<<<<<<<<<<<
 *             # no more data left
 *             raise StopAsyncIteration
 */
  }

  /* "asynctnt/iproto/push.pyx":68
 *             raise StopAsyncIteration
 * 
 *         if response.push_len() > 0:             # <<<<<<<<<<<<<<
 *             return response.pop_push()
 * 
 */
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len(__pyx_cur_scope->__pyx_v_response); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asynctnt/iproto/push.pyx":69
 * 
 *         if response.push_len() > 0:
 *             return response.pop_push()             # <<<<<<<<<<<<<<
 * 
 *         ev = response._push_event
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_8Response_pop_push(__pyx_cur_scope->__pyx_v_response); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/push.pyx":68
 *             raise StopAsyncIteration
 * 
 *         if response.push_len() > 0:             # <<<<<<<<<<<<<<
 *             return response.pop_push()
 * 
 */
  }

  /* "asynctnt/iproto/push.pyx":71
 *             return response.pop_push()
 * 
 *         ev = response._push_event             # <<<<<<<<<<<<<<
 *         await ev.wait()
 * 
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_response->_push_event;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ev = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/push.pyx":72
 * 
 *         ev = response._push_event
 *         await ev.wait()             # <<<<<<<<<<<<<<
 * 
 *         exc = response.get_exception()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ev, __pyx_n_s_wait); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, awaiting value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_await:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 72, __pyx_L1_error)
  } else {
    PyObject* exc_type = __Pyx_PyErr_Occurred();
    if (exc_type) {
      if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
      else __PYX_ERR(4, 72, __pyx_L1_error)
    }
  }

  /* "asynctnt/iproto/push.pyx":74
 *         await ev.wait()
 * 
 *         exc = response.get_exception()             # <<<<<<<<<<<<<<
 *         if exc is not None:
 *             # someone needs to await the underlying future
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_8Response_get_exception(__pyx_cur_scope->__pyx_v_response); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_exc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/push.pyx":75
 * 
 *         exc = response.get_exception()
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             # someone needs to await the underlying future
 *             # so we do it here, and most probably (like 99%) the exception
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_4)) {

    /* "asynctnt/iproto/push.pyx":82
 *             # But if it doesnt't throw we still await the future and throw
 *             # the exception ourselves.
 *             await self._fut             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->_fut);
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L10_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 82, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_Occurred();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(4, 82, __pyx_L1_error)
      }
    }

    /* "asynctnt/iproto/push.pyx":83
 *             # the exception ourselves.
 *             await self._fut
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         if response.push_len() > 0:
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(4, 83, __pyx_L1_error)

    /* "asynctnt/iproto/push.pyx":75
 * 
 *         exc = response.get_exception()
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             # someone needs to await the underlying future
 *             # so we do it here, and most probably (like 99%) the exception
 */
  }

  /* "asynctnt/iproto/push.pyx":85
 *             raise exc
 * 
 *         if response.push_len() > 0:             # <<<<<<<<<<<<<<
 *             return response.pop_push()
 * 
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len(__pyx_cur_scope->__pyx_v_response); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "asynctnt/iproto/push.pyx":86
 * 
 *         if response.push_len() > 0:
 *             return response.pop_push()             # <<<<<<<<<<<<<<
 * 
 *         if response._code >= 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_8Response_pop_push(__pyx_cur_scope->__pyx_v_response); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/push.pyx":85
 *             raise exc
 * 
 *         if response.push_len() > 0:             # <<<<<<<<<<<<<<
 *             return response.pop_push()
 * 
 */
  }

  /* "asynctnt/iproto/push.pyx":88
 *             return response.pop_push()
 * 
 *         if response._code >= 0:             # <<<<<<<<<<<<<<
 *             ev.clear()
 *             raise StopAsyncIteration
 */
  __pyx_t_4 = ((__pyx_cur_scope->__pyx_v_response->_code >= 0) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "asynctnt/iproto/push.pyx":89
 * 
 *         if response._code >= 0:
 *             ev.clear()             # <<<<<<<<<<<<<<
 *             raise StopAsyncIteration
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ev, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asynctnt/iproto/push.pyx":90
 *         if response._code >= 0:
 *             ev.clear()
 *             raise StopAsyncIteration             # <<<<<<<<<<<<<<
 * 
 *         assert False, 'Impossible condition happened. ' \
 */
    __Pyx_Raise(((PyObject *)(&((PyTypeObject*)__Pyx_PyExc_StopAsyncIteration)[0])), 0, 0, 0);
    __PYX_ERR(4, 90, __pyx_L1_error)

    /* "asynctnt/iproto/push.pyx":88
 *             return response.pop_push()
 * 
 *         if response._code >= 0:             # <<<<<<<<<<<<<<
 *             ev.clear()
 *             raise StopAsyncIteration
 */
  }

  /* "asynctnt/iproto/push.pyx":92
 *             raise StopAsyncIteration
 * 
 *         assert False, 'Impossible condition happened. ' \             # <<<<<<<<<<<<<<
 *                       'Please file a bug to ' \
 *                       'https://github.com/igorcoding/asynctnt'
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!0)) {
      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Impossible_condition_happened_Pl);
      __PYX_ERR(4, 92, __pyx_L1_error)
    }
  }
  #endif
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asynctnt/iproto/push.pyx":60
 * 
 *     @cython.iterable_coroutine
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         cdef Response response
 *         response = self._response
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("__anext__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/push.pyx":97
 * 
 *     @property
 *     def response(self):             # <<<<<<<<<<<<<<
 *         """
 *             Return current Response object. Might be handy to know if the
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_8response_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_8response_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_8response___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_8response___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/push.pyx":104
 *             :rtype: asynctnt.Response
 *         """
 *         return self._response             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_response));
  __pyx_r = ((PyObject *)__pyx_v_self->_response);
  goto __pyx_L0;

  /* "asynctnt/iproto/push.pyx":97
 * 
 *     @property
 *     def response(self):             # <<<<<<<<<<<<<<
 *         """
 *             Return current Response object. Might be handy to know if the
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_12__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_12__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_11__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_11__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._fut, self._request, self._response)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_fut);
  __Pyx_GIVEREF(__pyx_v_self->_fut);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_fut);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_request));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_request));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_request));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_response));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_response));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->_response));
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._fut, self._request, self._response)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self._fut, self._request, self._response)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._fut is not None or self._request is not None or self._response is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._fut, self._request, self._response)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._fut is not None or self._request is not None or self._response is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->_fut != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (((PyObject *)__pyx_v_self->_request) != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (((PyObject *)__pyx_v_self->_response) != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._fut is not None or self._request is not None or self._response is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self._fut is not None or self._request is not None or self._response is not None
 *     if use_setstate:
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_PushIterator); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_225261924);
    __Pyx_GIVEREF(__pyx_int_225261924);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_225261924);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._fut is not None or self._request is not None or self._response is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, None), state
 *     else:
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_PushIterator__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_PushIterator); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_225261924);
    __Pyx_GIVEREF(__pyx_int_225261924);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_225261924);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_PushIterator__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_14__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_14__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_13__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12PushIterator_13__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_PushIterator__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_PushIterator__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_PushIterator, (type(self), 0xd6d3964, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_PushIterator__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.PushIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":20
 * 
 * cdef class CoreProtocol:
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  host, port,
 *                  encoding=None,
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_encoding = 0;
  PyObject *__pyx_v_initial_read_buffer_size = 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_host,&__pyx_n_s_port,&__pyx_n_s_encoding,&__pyx_n_s_initial_read_buffer_size,0};
    PyObject* values[4] = {0,0,0,0};

    /* "asynctnt/iproto/coreproto.pyx":22
 *     def __init__(self,
 *                  host, port,
 *                  encoding=None,             # <<<<<<<<<<<<<<
 *                  initial_read_buffer_size=None):
 *         self.host = host
 */
    values[2] = ((PyObject *)Py_None);

    /* "asynctnt/iproto/coreproto.pyx":23
 *                  host, port,
 *                  encoding=None,
 *                  initial_read_buffer_size=None):             # <<<<<<<<<<<<<<
 *         self.host = host
 *         self.port = port
 */
    values[3] = ((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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(10, 20, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initial_read_buffer_size);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(10, 20, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_host = values[0];
    __pyx_v_port = values[1];
    __pyx_v_encoding = values[2];
    __pyx_v_initial_read_buffer_size = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 20, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol___init__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_encoding, __pyx_v_initial_read_buffer_size);

  /* "asynctnt/iproto/coreproto.pyx":20
 * 
 * cdef class CoreProtocol:
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  host, port,
 *                  encoding=None,
 */

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol___init__(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_encoding, PyObject *__pyx_v_initial_read_buffer_size) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_encoding);
  __Pyx_INCREF(__pyx_v_initial_read_buffer_size);

  /* "asynctnt/iproto/coreproto.pyx":24
 *                  encoding=None,
 *                  initial_read_buffer_size=None):
 *         self.host = host             # <<<<<<<<<<<<<<
 *         self.port = port
 * 
 */
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  __Pyx_GOTREF(__pyx_v_self->host);
  __Pyx_DECREF(__pyx_v_self->host);
  __pyx_v_self->host = __pyx_v_host;

  /* "asynctnt/iproto/coreproto.pyx":25
 *                  initial_read_buffer_size=None):
 *         self.host = host
 *         self.port = port             # <<<<<<<<<<<<<<
 * 
 *         encoding = encoding or b'utf-8'
 */
  __Pyx_INCREF(__pyx_v_port);
  __Pyx_GIVEREF(__pyx_v_port);
  __Pyx_GOTREF(__pyx_v_self->port);
  __Pyx_DECREF(__pyx_v_self->port);
  __pyx_v_self->port = __pyx_v_port;

  /* "asynctnt/iproto/coreproto.pyx":27
 *         self.port = port
 * 
 *         encoding = encoding or b'utf-8'             # <<<<<<<<<<<<<<
 *         if isinstance(encoding, str):
 *             self.encoding = encoding.encode()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(10, 27, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_encoding);
    __pyx_t_1 = __pyx_v_encoding;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_kp_b_utf_8);
  __pyx_t_1 = __pyx_kp_b_utf_8;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":28
 * 
 *         encoding = encoding or b'utf-8'
 *         if isinstance(encoding, str):             # <<<<<<<<<<<<<<
 *             self.encoding = encoding.encode()
 *         elif isinstance(self.encoding, bytes):
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_encoding); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "asynctnt/iproto/coreproto.pyx":29
 *         encoding = encoding or b'utf-8'
 *         if isinstance(encoding, str):
 *             self.encoding = encoding.encode()             # <<<<<<<<<<<<<<
 *         elif isinstance(self.encoding, bytes):
 *             self.encoding = encoding
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(10, 29, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->encoding);
    __Pyx_DECREF(__pyx_v_self->encoding);
    __pyx_v_self->encoding = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/coreproto.pyx":28
 * 
 *         encoding = encoding or b'utf-8'
 *         if isinstance(encoding, str):             # <<<<<<<<<<<<<<
 *             self.encoding = encoding.encode()
 *         elif isinstance(self.encoding, bytes):
 */
    goto __pyx_L5;
  }

  /* "asynctnt/iproto/coreproto.pyx":30
 *         if isinstance(encoding, str):
 *             self.encoding = encoding.encode()
 *         elif isinstance(self.encoding, bytes):             # <<<<<<<<<<<<<<
 *             self.encoding = encoding
 *         else:
 */
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = PyBytes_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "asynctnt/iproto/coreproto.pyx":31
 *             self.encoding = encoding.encode()
 *         elif isinstance(self.encoding, bytes):
 *             self.encoding = encoding             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('encoding must be either str or bytes')
 */
    if (!(likely(PyBytes_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_encoding)->tp_name), 0))) __PYX_ERR(10, 31, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_encoding;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->encoding);
    __Pyx_DECREF(__pyx_v_self->encoding);
    __pyx_v_self->encoding = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/coreproto.pyx":30
 *         if isinstance(encoding, str):
 *             self.encoding = encoding.encode()
 *         elif isinstance(self.encoding, bytes):             # <<<<<<<<<<<<<<
 *             self.encoding = encoding
 *         else:
 */
    goto __pyx_L5;
  }

  /* "asynctnt/iproto/coreproto.pyx":33
 *             self.encoding = encoding
 *         else:
 *             raise TypeError('encoding must be either str or bytes')             # <<<<<<<<<<<<<<
 * 
 *         initial_read_buffer_size = initial_read_buffer_size or 0x20000
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(10, 33, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "asynctnt/iproto/coreproto.pyx":35
 *             raise TypeError('encoding must be either str or bytes')
 * 
 *         initial_read_buffer_size = initial_read_buffer_size or 0x20000             # <<<<<<<<<<<<<<
 *         self.transport = None
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_initial_read_buffer_size); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(10, 35, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_initial_read_buffer_size);
    __pyx_t_1 = __pyx_v_initial_read_buffer_size;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyInt_From_long(0x20000); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_initial_read_buffer_size, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":36
 * 
 *         initial_read_buffer_size = initial_read_buffer_size or 0x20000
 *         self.transport = None             # <<<<<<<<<<<<<<
 * 
 *         self.rbuf = ReadBuffer.new(encoding, initial_read_buffer_size)
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_transport, Py_None) < 0) __PYX_ERR(10, 36, __pyx_L1_error)

  /* "asynctnt/iproto/coreproto.pyx":38
 *         self.transport = None
 * 
 *         self.rbuf = ReadBuffer.new(encoding, initial_read_buffer_size)             # <<<<<<<<<<<<<<
 *         self.state = PROTOCOL_IDLE
 *         self.con_state = CONNECTION_BAD
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_encoding))||((__pyx_v_encoding) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_encoding)->tp_name), 0))) __PYX_ERR(10, 38, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_initial_read_buffer_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 38, __pyx_L1_error)
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.initial_buffer_size = __pyx_t_6;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8asynctnt_6iproto_8protocol_ReadBuffer->new(((PyObject*)__pyx_v_encoding), &__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->rbuf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->rbuf));
  __pyx_v_self->rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":39
 * 
 *         self.rbuf = ReadBuffer.new(encoding, initial_read_buffer_size)
 *         self.state = PROTOCOL_IDLE             # <<<<<<<<<<<<<<
 *         self.con_state = CONNECTION_BAD
 * 
 */
  __pyx_v_self->state = __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_IDLE;

  /* "asynctnt/iproto/coreproto.pyx":40
 *         self.rbuf = ReadBuffer.new(encoding, initial_read_buffer_size)
 *         self.state = PROTOCOL_IDLE
 *         self.con_state = CONNECTION_BAD             # <<<<<<<<<<<<<<
 * 
 *         self.version = None
 */
  __pyx_v_self->con_state = __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_BAD;

  /* "asynctnt/iproto/coreproto.pyx":42
 *         self.con_state = CONNECTION_BAD
 * 
 *         self.version = None             # <<<<<<<<<<<<<<
 *         self.salt = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->version);
  __Pyx_DECREF(__pyx_v_self->version);
  __pyx_v_self->version = ((PyObject*)Py_None);

  /* "asynctnt/iproto/coreproto.pyx":43
 * 
 *         self.version = None
 *         self.salt = None             # <<<<<<<<<<<<<<
 * 
 *     cdef bint _is_connected(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->salt);
  __Pyx_DECREF(__pyx_v_self->salt);
  __pyx_v_self->salt = ((PyObject*)Py_None);

  /* "asynctnt/iproto/coreproto.pyx":20
 * 
 * cdef class CoreProtocol:
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  host, port,
 *                  encoding=None,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_encoding);
  __Pyx_XDECREF(__pyx_v_initial_read_buffer_size);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":45
 *         self.salt = None
 * 
 *     cdef bint _is_connected(self):             # <<<<<<<<<<<<<<
 *         return self.con_state != CONNECTION_BAD
 * 
 */

static int __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__is_connected(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_connected", 0);

  /* "asynctnt/iproto/coreproto.pyx":46
 * 
 *     cdef bint _is_connected(self):
 *         return self.con_state != CONNECTION_BAD             # <<<<<<<<<<<<<<
 * 
 *     cdef bint _is_fully_connected(self):
 */
  __pyx_r = (__pyx_v_self->con_state != __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_BAD);
  goto __pyx_L0;

  /* "asynctnt/iproto/coreproto.pyx":45
 *         self.salt = None
 * 
 *     cdef bint _is_connected(self):             # <<<<<<<<<<<<<<
 *         return self.con_state != CONNECTION_BAD
 * 
 */

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

/* "asynctnt/iproto/coreproto.pyx":48
 *         return self.con_state != CONNECTION_BAD
 * 
 *     cdef bint _is_fully_connected(self):             # <<<<<<<<<<<<<<
 *         return self.con_state == CONNECTION_FULL
 * 
 */

static int __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__is_fully_connected(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_fully_connected", 0);

  /* "asynctnt/iproto/coreproto.pyx":49
 * 
 *     cdef bint _is_fully_connected(self):
 *         return self.con_state == CONNECTION_FULL             # <<<<<<<<<<<<<<
 * 
 *     def is_connected(self):
 */
  __pyx_r = (__pyx_v_self->con_state == __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_FULL);
  goto __pyx_L0;

  /* "asynctnt/iproto/coreproto.pyx":48
 *         return self.con_state != CONNECTION_BAD
 * 
 *     cdef bint _is_fully_connected(self):             # <<<<<<<<<<<<<<
 *         return self.con_state == CONNECTION_FULL
 * 
 */

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

/* "asynctnt/iproto/coreproto.pyx":51
 *         return self.con_state == CONNECTION_FULL
 * 
 *     def is_connected(self):             # <<<<<<<<<<<<<<
 *         return self._is_connected()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_3is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_3is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_connected (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_2is_connected(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/coreproto.pyx":52
 * 
 *     def is_connected(self):
 *         return self._is_connected()             # <<<<<<<<<<<<<<
 * 
 *     def is_fully_connected(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_is_connected(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/coreproto.pyx":51
 *         return self.con_state == CONNECTION_FULL
 * 
 *     def is_connected(self):             # <<<<<<<<<<<<<<
 *         return self._is_connected()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.is_connected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":54
 *         return self._is_connected()
 * 
 *     def is_fully_connected(self):             # <<<<<<<<<<<<<<
 *         return self._is_fully_connected()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_5is_fully_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_5is_fully_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_fully_connected (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_4is_fully_connected(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/coreproto.pyx":55
 * 
 *     def is_fully_connected(self):
 *         return self._is_fully_connected()             # <<<<<<<<<<<<<<
 * 
 *     def get_version(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_is_fully_connected(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/coreproto.pyx":54
 *         return self._is_connected()
 * 
 *     def is_fully_connected(self):             # <<<<<<<<<<<<<<
 *         return self._is_fully_connected()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.is_fully_connected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":57
 *         return self._is_fully_connected()
 * 
 *     def get_version(self):             # <<<<<<<<<<<<<<
 *         return self.version
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_7get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_7get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_version (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_6get_version(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_6get_version(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_version", 0);

  /* "asynctnt/iproto/coreproto.pyx":58
 * 
 *     def get_version(self):
 *         return self.version             # <<<<<<<<<<<<<<
 * 
 *     cdef void _write(self, buf) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->version);
  __pyx_r = __pyx_v_self->version;
  goto __pyx_L0;

  /* "asynctnt/iproto/coreproto.pyx":57
 *         return self._is_fully_connected()
 * 
 *     def get_version(self):             # <<<<<<<<<<<<<<
 *         return self.version
 * 
 */

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

/* "asynctnt/iproto/coreproto.pyx":60
 *         return self.version
 * 
 *     cdef void _write(self, buf) except *:             # <<<<<<<<<<<<<<
 *         self.transport.write(memoryview(buf))
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__write(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_buf) {
  __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("_write", 0);

  /* "asynctnt/iproto/coreproto.pyx":61
 * 
 *     cdef void _write(self, buf) except *:
 *         self.transport.write(memoryview(buf))             # <<<<<<<<<<<<<<
 * 
 *     cdef void _on_data_received(self, data):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_transport); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":60
 *         return self.version
 * 
 *     cdef void _write(self, buf) except *:             # <<<<<<<<<<<<<<
 *         self.transport.write(memoryview(buf))
 * 
 */

  /* function exit 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_AddTraceback("asynctnt.iproto.protocol.CoreProtocol._write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/coreproto.pyx":63
 *         self.transport.write(memoryview(buf))
 * 
 *     cdef void _on_data_received(self, data):             # <<<<<<<<<<<<<<
 *         cdef:
 *             size_t ruse, curr
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_data_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data) {
  char const *__pyx_v_p;
  char const *__pyx_v_q;
  uint32_t __pyx_v_packet_len;
  char *__pyx_v_data_str;
  Py_ssize_t __pyx_v_data_len;
  Py_ssize_t __pyx_v_buf_len;
  char *__pyx_v_end;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_data_received", 0);

  /* "asynctnt/iproto/coreproto.pyx":74
 *             ssize_t buf_len
 * 
 *         if not cpython.PyBytes_CheckExact(data):             # <<<<<<<<<<<<<<
 *             raise BufferError('_on_data_received: expected bytes object')
 * 
 */
  __pyx_t_1 = ((!(PyBytes_CheckExact(__pyx_v_data) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/coreproto.pyx":75
 * 
 *         if not cpython.PyBytes_CheckExact(data):
 *             raise BufferError('_on_data_received: expected bytes object')             # <<<<<<<<<<<<<<
 * 
 *         data_str = NULL
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_BufferError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(10, 75, __pyx_L1_error)

    /* "asynctnt/iproto/coreproto.pyx":74
 *             ssize_t buf_len
 * 
 *         if not cpython.PyBytes_CheckExact(data):             # <<<<<<<<<<<<<<
 *             raise BufferError('_on_data_received: expected bytes object')
 * 
 */
  }

  /* "asynctnt/iproto/coreproto.pyx":77
 *             raise BufferError('_on_data_received: expected bytes object')
 * 
 *         data_str = NULL             # <<<<<<<<<<<<<<
 *         data_len = 0
 *         cpython.bytes.PyBytes_AsStringAndSize(<bytes>data,
 */
  __pyx_v_data_str = NULL;

  /* "asynctnt/iproto/coreproto.pyx":78
 * 
 *         data_str = NULL
 *         data_len = 0             # <<<<<<<<<<<<<<
 *         cpython.bytes.PyBytes_AsStringAndSize(<bytes>data,
 *                                               &data_str,
 */
  __pyx_v_data_len = 0;

  /* "asynctnt/iproto/coreproto.pyx":79
 *         data_str = NULL
 *         data_len = 0
 *         cpython.bytes.PyBytes_AsStringAndSize(<bytes>data,             # <<<<<<<<<<<<<<
 *                                               &data_str,
 *                                               &data_len)
 */
  __pyx_t_3 = PyBytes_AsStringAndSize(__pyx_v_data, (&__pyx_v_data_str), ((Py_ssize_t *)(&__pyx_v_data_len))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(10, 79, __pyx_L1_error)

  /* "asynctnt/iproto/coreproto.pyx":82
 *                                               &data_str,
 *                                               &data_len)
 *         if data_len == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_len == 0) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/coreproto.pyx":83
 *                                               &data_len)
 *         if data_len == 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.rbuf.extend(data_str, data_len)
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/coreproto.pyx":82
 *                                               &data_str,
 *                                               &data_len)
 *         if data_len == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/coreproto.pyx":85
 *             return
 * 
 *         self.rbuf.extend(data_str, data_len)             # <<<<<<<<<<<<<<
 * 
 *         if self.state == PROTOCOL_GREETING:
 */
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_extend(__pyx_v_self->rbuf, __pyx_v_data_str, __pyx_v_data_len); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(10, 85, __pyx_L1_error)

  /* "asynctnt/iproto/coreproto.pyx":87
 *         self.rbuf.extend(data_str, data_len)
 * 
 *         if self.state == PROTOCOL_GREETING:             # <<<<<<<<<<<<<<
 *             if self.rbuf.use < IPROTO_GREETING_SIZE:
 *                 # not enough for greeting
 */
  switch (__pyx_v_self->state) {
    case __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_GREETING:

    /* "asynctnt/iproto/coreproto.pyx":88
 * 
 *         if self.state == PROTOCOL_GREETING:
 *             if self.rbuf.use < IPROTO_GREETING_SIZE:             # <<<<<<<<<<<<<<
 *                 # not enough for greeting
 *                 return
 */
    __pyx_t_1 = ((__pyx_v_self->rbuf->use < 0x80) != 0);
    if (__pyx_t_1) {

      /* "asynctnt/iproto/coreproto.pyx":90
 *             if self.rbuf.use < IPROTO_GREETING_SIZE:
 *                 # not enough for greeting
 *                 return             # <<<<<<<<<<<<<<
 *             self._process__greeting()
 *             self.rbuf.move(IPROTO_GREETING_SIZE)
 */
      goto __pyx_L0;

      /* "asynctnt/iproto/coreproto.pyx":88
 * 
 *         if self.state == PROTOCOL_GREETING:
 *             if self.rbuf.use < IPROTO_GREETING_SIZE:             # <<<<<<<<<<<<<<
 *                 # not enough for greeting
 *                 return
 */
    }

    /* "asynctnt/iproto/coreproto.pyx":91
 *                 # not enough for greeting
 *                 return
 *             self._process__greeting()             # <<<<<<<<<<<<<<
 *             self.rbuf.move(IPROTO_GREETING_SIZE)
 *         elif self.state == PROTOCOL_NORMAL:
 */
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__greeting(__pyx_v_self);

    /* "asynctnt/iproto/coreproto.pyx":92
 *                 return
 *             self._process__greeting()
 *             self.rbuf.move(IPROTO_GREETING_SIZE)             # <<<<<<<<<<<<<<
 *         elif self.state == PROTOCOL_NORMAL:
 *             p = self.rbuf.buf
 */
    __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move(__pyx_v_self->rbuf, 0x80);

    /* "asynctnt/iproto/coreproto.pyx":87
 *         self.rbuf.extend(data_str, data_len)
 * 
 *         if self.state == PROTOCOL_GREETING:             # <<<<<<<<<<<<<<
 *             if self.rbuf.use < IPROTO_GREETING_SIZE:
 *                 # not enough for greeting
 */
    break;
    case __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_NORMAL:

    /* "asynctnt/iproto/coreproto.pyx":94
 *             self.rbuf.move(IPROTO_GREETING_SIZE)
 *         elif self.state == PROTOCOL_NORMAL:
 *             p = self.rbuf.buf             # <<<<<<<<<<<<<<
 *             end = &self.rbuf.buf[self.rbuf.use]
 * 
 */
    __pyx_t_4 = __pyx_v_self->rbuf->buf;
    __pyx_v_p = __pyx_t_4;

    /* "asynctnt/iproto/coreproto.pyx":95
 *         elif self.state == PROTOCOL_NORMAL:
 *             p = self.rbuf.buf
 *             end = &self.rbuf.buf[self.rbuf.use]             # <<<<<<<<<<<<<<
 * 
 *             while p < end:
 */
    __pyx_v_end = (&(__pyx_v_self->rbuf->buf[__pyx_v_self->rbuf->use]));

    /* "asynctnt/iproto/coreproto.pyx":97
 *             end = &self.rbuf.buf[self.rbuf.use]
 * 
 *             while p < end:             # <<<<<<<<<<<<<<
 *                 q = p  # q is temporary to parse packet length
 *                 buf_len = end - p
 */
    while (1) {
      __pyx_t_1 = ((__pyx_v_p < __pyx_v_end) != 0);
      if (!__pyx_t_1) break;

      /* "asynctnt/iproto/coreproto.pyx":98
 * 
 *             while p < end:
 *                 q = p  # q is temporary to parse packet length             # <<<<<<<<<<<<<<
 *                 buf_len = end - p
 *                 if buf_len < 5:
 */
      __pyx_v_q = __pyx_v_p;

      /* "asynctnt/iproto/coreproto.pyx":99
 *             while p < end:
 *                 q = p  # q is temporary to parse packet length
 *                 buf_len = end - p             # <<<<<<<<<<<<<<
 *                 if buf_len < 5:
 *                     # not enough
 */
      __pyx_v_buf_len = (__pyx_v_end - __pyx_v_p);

      /* "asynctnt/iproto/coreproto.pyx":100
 *                 q = p  # q is temporary to parse packet length
 *                 buf_len = end - p
 *                 if buf_len < 5:             # <<<<<<<<<<<<<<
 *                     # not enough
 *                     break
 */
      __pyx_t_1 = ((__pyx_v_buf_len < 5) != 0);
      if (__pyx_t_1) {

        /* "asynctnt/iproto/coreproto.pyx":102
 *                 if buf_len < 5:
 *                     # not enough
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 q = &q[1]  # skip to 2nd byte of packet length
 */
        goto __pyx_L7_break;

        /* "asynctnt/iproto/coreproto.pyx":100
 *                 q = p  # q is temporary to parse packet length
 *                 buf_len = end - p
 *                 if buf_len < 5:             # <<<<<<<<<<<<<<
 *                     # not enough
 *                     break
 */
      }

      /* "asynctnt/iproto/coreproto.pyx":104
 *                     break
 * 
 *                 q = &q[1]  # skip to 2nd byte of packet length             # <<<<<<<<<<<<<<
 *                 packet_len = mp_load_u32(&q)
 * 
 */
      __pyx_v_q = (&(__pyx_v_q[1]));

      /* "asynctnt/iproto/coreproto.pyx":105
 * 
 *                 q = &q[1]  # skip to 2nd byte of packet length
 *                 packet_len = mp_load_u32(&q)             # <<<<<<<<<<<<<<
 * 
 *                 if buf_len < 5 + packet_len:
 */
      __pyx_v_packet_len = mp_load_u32((&__pyx_v_q));

      /* "asynctnt/iproto/coreproto.pyx":107
 *                 packet_len = mp_load_u32(&q)
 * 
 *                 if buf_len < 5 + packet_len:             # <<<<<<<<<<<<<<
 *                     # not enough to read an entire packet
 *                     break
 */
      __pyx_t_1 = ((__pyx_v_buf_len < (5 + __pyx_v_packet_len)) != 0);
      if (__pyx_t_1) {

        /* "asynctnt/iproto/coreproto.pyx":109
 *                 if buf_len < 5 + packet_len:
 *                     # not enough to read an entire packet
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 p = &p[5]  # skip length header
 */
        goto __pyx_L7_break;

        /* "asynctnt/iproto/coreproto.pyx":107
 *                 packet_len = mp_load_u32(&q)
 * 
 *                 if buf_len < 5 + packet_len:             # <<<<<<<<<<<<<<
 *                     # not enough to read an entire packet
 *                     break
 */
      }

      /* "asynctnt/iproto/coreproto.pyx":111
 *                     break
 * 
 *                 p = &p[5]  # skip length header             # <<<<<<<<<<<<<<
 *                 self._on_response_received(p, packet_len)
 *                 p = &p[packet_len]
 */
      __pyx_v_p = (&(__pyx_v_p[5]));

      /* "asynctnt/iproto/coreproto.pyx":112
 * 
 *                 p = &p[5]  # skip length header
 *                 self._on_response_received(p, packet_len)             # <<<<<<<<<<<<<<
 *                 p = &p[packet_len]
 * 
 */
      ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_response_received(__pyx_v_self, __pyx_v_p, __pyx_v_packet_len);

      /* "asynctnt/iproto/coreproto.pyx":113
 *                 p = &p[5]  # skip length header
 *                 self._on_response_received(p, packet_len)
 *                 p = &p[packet_len]             # <<<<<<<<<<<<<<
 * 
 *                 if p == end:
 */
      __pyx_v_p = (&(__pyx_v_p[__pyx_v_packet_len]));

      /* "asynctnt/iproto/coreproto.pyx":115
 *                 p = &p[packet_len]
 * 
 *                 if p == end:             # <<<<<<<<<<<<<<
 *                     self.rbuf.use = 0
 *                     break
 */
      __pyx_t_1 = ((__pyx_v_p == __pyx_v_end) != 0);
      if (__pyx_t_1) {

        /* "asynctnt/iproto/coreproto.pyx":116
 * 
 *                 if p == end:
 *                     self.rbuf.use = 0             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_v_self->rbuf->use = 0;

        /* "asynctnt/iproto/coreproto.pyx":117
 *                 if p == end:
 *                     self.rbuf.use = 0
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             self.rbuf.use = end - p
 */
        goto __pyx_L7_break;

        /* "asynctnt/iproto/coreproto.pyx":115
 *                 p = &p[packet_len]
 * 
 *                 if p == end:             # <<<<<<<<<<<<<<
 *                     self.rbuf.use = 0
 *                     break
 */
      }
    }
    __pyx_L7_break:;

    /* "asynctnt/iproto/coreproto.pyx":119
 *                     break
 * 
 *             self.rbuf.use = end - p             # <<<<<<<<<<<<<<
 *             if self.rbuf.use > 0:
 *                 self.rbuf.move_offset(p - self.rbuf.buf, self.rbuf.use)
 */
    __pyx_v_self->rbuf->use = (__pyx_v_end - __pyx_v_p);

    /* "asynctnt/iproto/coreproto.pyx":120
 * 
 *             self.rbuf.use = end - p
 *             if self.rbuf.use > 0:             # <<<<<<<<<<<<<<
 *                 self.rbuf.move_offset(p - self.rbuf.buf, self.rbuf.use)
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_self->rbuf->use > 0) != 0);
    if (__pyx_t_1) {

      /* "asynctnt/iproto/coreproto.pyx":121
 *             self.rbuf.use = end - p
 *             if self.rbuf.use > 0:
 *                 self.rbuf.move_offset(p - self.rbuf.buf, self.rbuf.use)             # <<<<<<<<<<<<<<
 *         else:
 *             # TODO: raise exception
 */
      __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move_offset(__pyx_v_self->rbuf, (__pyx_v_p - __pyx_v_self->rbuf->buf), __pyx_v_self->rbuf->use); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 121, __pyx_L1_error)

      /* "asynctnt/iproto/coreproto.pyx":120
 * 
 *             self.rbuf.use = end - p
 *             if self.rbuf.use > 0:             # <<<<<<<<<<<<<<
 *                 self.rbuf.move_offset(p - self.rbuf.buf, self.rbuf.use)
 *         else:
 */
    }

    /* "asynctnt/iproto/coreproto.pyx":93
 *             self._process__greeting()
 *             self.rbuf.move(IPROTO_GREETING_SIZE)
 *         elif self.state == PROTOCOL_NORMAL:             # <<<<<<<<<<<<<<
 *             p = self.rbuf.buf
 *             end = &self.rbuf.buf[self.rbuf.use]
 */
    break;
    default:
    break;
  }

  /* "asynctnt/iproto/coreproto.pyx":63
 *         self.transport.write(memoryview(buf))
 * 
 *     cdef void _on_data_received(self, data):             # <<<<<<<<<<<<<<
 *         cdef:
 *             size_t ruse, curr
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.CoreProtocol._on_data_received", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/coreproto.pyx":126
 *             pass
 * 
 *     cdef void _process__greeting(self):             # <<<<<<<<<<<<<<
 *         cdef size_t ver_length = TARANTOOL_VERSION_LENGTH
 *         rbuf = self.rbuf
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__process__greeting(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  size_t __pyx_v_ver_length;
  CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *__pyx_v_rbuf = 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("_process__greeting", 0);

  /* "asynctnt/iproto/coreproto.pyx":127
 * 
 *     cdef void _process__greeting(self):
 *         cdef size_t ver_length = TARANTOOL_VERSION_LENGTH             # <<<<<<<<<<<<<<
 *         rbuf = self.rbuf
 *         self.version = self._parse_version(self.rbuf.get_slice_end(ver_length))
 */
  __pyx_v_ver_length = 64;

  /* "asynctnt/iproto/coreproto.pyx":128
 *     cdef void _process__greeting(self):
 *         cdef size_t ver_length = TARANTOOL_VERSION_LENGTH
 *         rbuf = self.rbuf             # <<<<<<<<<<<<<<
 *         self.version = self._parse_version(self.rbuf.get_slice_end(ver_length))
 *         self.salt = base64.b64decode(
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->rbuf);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":129
 *         cdef size_t ver_length = TARANTOOL_VERSION_LENGTH
 *         rbuf = self.rbuf
 *         self.version = self._parse_version(self.rbuf.get_slice_end(ver_length))             # <<<<<<<<<<<<<<
 *         self.salt = base64.b64decode(
 *             self.rbuf.get_slice(ver_length,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parse_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_end(__pyx_v_self->rbuf, __pyx_v_ver_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(10, 129, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->version);
  __Pyx_DECREF(__pyx_v_self->version);
  __pyx_v_self->version = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":130
 *         rbuf = self.rbuf
 *         self.version = self._parse_version(self.rbuf.get_slice_end(ver_length))
 *         self.salt = base64.b64decode(             # <<<<<<<<<<<<<<
 *             self.rbuf.get_slice(ver_length,
 *                                 ver_length + SALT_LENGTH)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_b64decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/coreproto.pyx":131
 *         self.version = self._parse_version(self.rbuf.get_slice_end(ver_length))
 *         self.salt = base64.b64decode(
 *             self.rbuf.get_slice(ver_length,             # <<<<<<<<<<<<<<
 *                                 ver_length + SALT_LENGTH)
 *         )[:SCRAMBLE_SIZE]
 */
  __pyx_t_2 = __pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice(__pyx_v_self->rbuf, __pyx_v_ver_length, (__pyx_v_ver_length + 44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asynctnt/iproto/coreproto.pyx":133
 *             self.rbuf.get_slice(ver_length,
 *                                 ver_length + SALT_LENGTH)
 *         )[:SCRAMBLE_SIZE]             # <<<<<<<<<<<<<<
 *         self.state = PROTOCOL_NORMAL
 *         self._on_greeting_received()
 */
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 20, NULL, NULL, &__pyx_slice__56, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(10, 133, __pyx_L1_error)

  /* "asynctnt/iproto/coreproto.pyx":130
 *         rbuf = self.rbuf
 *         self.version = self._parse_version(self.rbuf.get_slice_end(ver_length))
 *         self.salt = base64.b64decode(             # <<<<<<<<<<<<<<
 *             self.rbuf.get_slice(ver_length,
 *                                 ver_length + SALT_LENGTH)
 */
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->salt);
  __Pyx_DECREF(__pyx_v_self->salt);
  __pyx_v_self->salt = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asynctnt/iproto/coreproto.pyx":134
 *                                 ver_length + SALT_LENGTH)
 *         )[:SCRAMBLE_SIZE]
 *         self.state = PROTOCOL_NORMAL             # <<<<<<<<<<<<<<
 *         self._on_greeting_received()
 * 
 */
  __pyx_v_self->state = __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_NORMAL;

  /* "asynctnt/iproto/coreproto.pyx":135
 *         )[:SCRAMBLE_SIZE]
 *         self.state = PROTOCOL_NORMAL
 *         self._on_greeting_received()             # <<<<<<<<<<<<<<
 * 
 *     def _parse_version(self, version):
 */
  ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_greeting_received(__pyx_v_self);

  /* "asynctnt/iproto/coreproto.pyx":126
 *             pass
 * 
 *     cdef void _process__greeting(self):             # <<<<<<<<<<<<<<
 *         cdef size_t ver_length = TARANTOOL_VERSION_LENGTH
 *         rbuf = self.rbuf
 */

  /* function exit 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_WriteUnraisable("asynctnt.iproto.protocol.CoreProtocol._process__greeting", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rbuf);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/coreproto.pyx":137
 *         self._on_greeting_received()
 * 
 *     def _parse_version(self, version):             # <<<<<<<<<<<<<<
 *         m = VERSION_STRING_REGEX.match(version.decode('ascii'))
 *         if m is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_9_parse_version(PyObject *__pyx_v_self, PyObject *__pyx_v_version); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_9_parse_version(PyObject *__pyx_v_self, PyObject *__pyx_v_version) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_parse_version (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_8_parse_version(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_version));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_8_parse_version(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_version) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_ver = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_version", 0);

  /* "asynctnt/iproto/coreproto.pyx":138
 * 
 *     def _parse_version(self, version):
 *         m = VERSION_STRING_REGEX.match(version.decode('ascii'))             # <<<<<<<<<<<<<<
 *         if m is not None:
 *             ver = m.group(1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_STRING_REGEX); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_version, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_ascii);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":139
 *     def _parse_version(self, version):
 *         m = VERSION_STRING_REGEX.match(version.decode('ascii'))
 *         if m is not None:             # <<<<<<<<<<<<<<
 *             ver = m.group(1)
 *             return tuple(map(int, ver.split('.')))
 */
  __pyx_t_6 = (__pyx_v_m != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "asynctnt/iproto/coreproto.pyx":140
 *         m = VERSION_STRING_REGEX.match(version.decode('ascii'))
 *         if m is not None:
 *             ver = m.group(1)             # <<<<<<<<<<<<<<
 *             return tuple(map(int, ver.split('.')))
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_ver = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/coreproto.pyx":141
 *         if m is not None:
 *             ver = m.group(1)
 *             return tuple(map(int, ver.split('.')))             # <<<<<<<<<<<<<<
 * 
 *     cdef void _on_greeting_received(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ver, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u__57) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__57);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "asynctnt/iproto/coreproto.pyx":139
 *     def _parse_version(self, version):
 *         m = VERSION_STRING_REGEX.match(version.decode('ascii'))
 *         if m is not None:             # <<<<<<<<<<<<<<
 *             ver = m.group(1)
 *             return tuple(map(int, ver.split('.')))
 */
  }

  /* "asynctnt/iproto/coreproto.pyx":137
 *         self._on_greeting_received()
 * 
 *     def _parse_version(self, version):             # <<<<<<<<<<<<<<
 *         m = VERSION_STRING_REGEX.match(version.decode('ascii'))
 *         if m is not 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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol._parse_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_ver);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":143
 *             return tuple(map(int, ver.split('.')))
 * 
 *     cdef void _on_greeting_received(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_greeting_received(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_greeting_received", 0);

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

/* "asynctnt/iproto/coreproto.pyx":146
 *         pass
 * 
 *     cdef void _on_response_received(self, const char *buf, uint32_t buf_len):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_response_received(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED char const *__pyx_v_buf, CYTHON_UNUSED uint32_t __pyx_v_buf_len) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_response_received", 0);

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

/* "asynctnt/iproto/coreproto.pyx":149
 *         pass
 * 
 *     cdef void _on_connection_made(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_made(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_connection_made", 0);

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

/* "asynctnt/iproto/coreproto.pyx":152
 *         pass
 * 
 *     cdef void _on_connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_lost(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_connection_lost", 0);

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

/* "asynctnt/iproto/coreproto.pyx":157
 *     # asyncio callbacks
 * 
 *     def data_received(self, data):             # <<<<<<<<<<<<<<
 *         self._on_data_received(data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_11data_received(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_11data_received(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("data_received (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_10data_received(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_10data_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("data_received", 0);

  /* "asynctnt/iproto/coreproto.pyx":158
 * 
 *     def data_received(self, data):
 *         self._on_data_received(data)             # <<<<<<<<<<<<<<
 * 
 *     def connection_made(self, transport):
 */
  ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_data_received(__pyx_v_self, __pyx_v_data);

  /* "asynctnt/iproto/coreproto.pyx":157
 *     # asyncio callbacks
 * 
 *     def data_received(self, data):             # <<<<<<<<<<<<<<
 *         self._on_data_received(data)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":160
 *         self._on_data_received(data)
 * 
 *     def connection_made(self, transport):             # <<<<<<<<<<<<<<
 *         self.transport = transport
 *         self.con_state = CONNECTION_CONNECTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_13connection_made(PyObject *__pyx_v_self, PyObject *__pyx_v_transport); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_13connection_made(PyObject *__pyx_v_self, PyObject *__pyx_v_transport) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connection_made (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_12connection_made(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_transport));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_12connection_made(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_transport) {
  PyObject *__pyx_v_sock = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  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("connection_made", 0);

  /* "asynctnt/iproto/coreproto.pyx":161
 * 
 *     def connection_made(self, transport):
 *         self.transport = transport             # <<<<<<<<<<<<<<
 *         self.con_state = CONNECTION_CONNECTED
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_transport, __pyx_v_transport) < 0) __PYX_ERR(10, 161, __pyx_L1_error)

  /* "asynctnt/iproto/coreproto.pyx":162
 *     def connection_made(self, transport):
 *         self.transport = transport
 *         self.con_state = CONNECTION_CONNECTED             # <<<<<<<<<<<<<<
 * 
 *         sock = transport.get_extra_info('socket')
 */
  __pyx_v_self->con_state = __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_CONNECTED;

  /* "asynctnt/iproto/coreproto.pyx":164
 *         self.con_state = CONNECTION_CONNECTED
 * 
 *         sock = transport.get_extra_info('socket')             # <<<<<<<<<<<<<<
 *         if sock is not None \
 *                 and (not hasattr(socket, 'AF_UNIX')
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_transport, __pyx_n_s_get_extra_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_socket) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_socket);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sock = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":165
 * 
 *         sock = transport.get_extra_info('socket')
 *         if sock is not None \             # <<<<<<<<<<<<<<
 *                 and (not hasattr(socket, 'AF_UNIX')
 *                      or sock.family != socket.AF_UNIX):
 */
  __pyx_t_5 = (__pyx_v_sock != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asynctnt/iproto/coreproto.pyx":166
 *         sock = transport.get_extra_info('socket')
 *         if sock is not None \
 *                 and (not hasattr(socket, 'AF_UNIX')             # <<<<<<<<<<<<<<
 *                      or sock.family != socket.AF_UNIX):
 *             sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_AF_UNIX); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(10, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!(__pyx_t_6 != 0)) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asynctnt/iproto/coreproto.pyx":167
 *         if sock is not None \
 *                 and (not hasattr(socket, 'AF_UNIX')
 *                      or sock.family != socket.AF_UNIX):             # <<<<<<<<<<<<<<
 *             sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AF_UNIX); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(10, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;

  /* "asynctnt/iproto/coreproto.pyx":165
 * 
 *         sock = transport.get_extra_info('socket')
 *         if sock is not None \             # <<<<<<<<<<<<<<
 *                 and (not hasattr(socket, 'AF_UNIX')
 *                      or sock.family != socket.AF_UNIX):
 */
  if (__pyx_t_4) {

    /* "asynctnt/iproto/coreproto.pyx":168
 *                 and (not hasattr(socket, 'AF_UNIX')
 *                      or sock.family != socket.AF_UNIX):
 *             sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)             # <<<<<<<<<<<<<<
 * 
 *         self.state = PROTOCOL_GREETING
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_7, __pyx_t_8, __pyx_int_1};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 168, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_7, __pyx_t_8, __pyx_int_1};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 168, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(10, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_int_1);
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asynctnt/iproto/coreproto.pyx":165
 * 
 *         sock = transport.get_extra_info('socket')
 *         if sock is not None \             # <<<<<<<<<<<<<<
 *                 and (not hasattr(socket, 'AF_UNIX')
 *                      or sock.family != socket.AF_UNIX):
 */
  }

  /* "asynctnt/iproto/coreproto.pyx":170
 *             sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 * 
 *         self.state = PROTOCOL_GREETING             # <<<<<<<<<<<<<<
 *         self._on_connection_made()
 * 
 */
  __pyx_v_self->state = __pyx_e_8asynctnt_6iproto_8protocol_PROTOCOL_GREETING;

  /* "asynctnt/iproto/coreproto.pyx":171
 * 
 *         self.state = PROTOCOL_GREETING
 *         self._on_connection_made()             # <<<<<<<<<<<<<<
 * 
 *     def connection_lost(self, exc):
 */
  ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_connection_made(__pyx_v_self);

  /* "asynctnt/iproto/coreproto.pyx":160
 *         self._on_data_received(data)
 * 
 *     def connection_made(self, transport):             # <<<<<<<<<<<<<<
 *         self.transport = transport
 *         self.con_state = CONNECTION_CONNECTED
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sock);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/coreproto.pyx":173
 *         self._on_connection_made()
 * 
 *     def connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         self.con_state = CONNECTION_BAD
 *         # self.schema = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_15connection_lost(PyObject *__pyx_v_self, PyObject *__pyx_v_exc); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_15connection_lost(PyObject *__pyx_v_self, PyObject *__pyx_v_exc) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connection_lost (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_14connection_lost(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_exc));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_14connection_lost(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_exc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connection_lost", 0);

  /* "asynctnt/iproto/coreproto.pyx":174
 * 
 *     def connection_lost(self, exc):
 *         self.con_state = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *         # self.schema = None
 *         self.version = None
 */
  __pyx_v_self->con_state = __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_BAD;

  /* "asynctnt/iproto/coreproto.pyx":176
 *         self.con_state = CONNECTION_BAD
 *         # self.schema = None
 *         self.version = None             # <<<<<<<<<<<<<<
 *         self.salt = None
 *         self.rbuf = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->version);
  __Pyx_DECREF(__pyx_v_self->version);
  __pyx_v_self->version = ((PyObject*)Py_None);

  /* "asynctnt/iproto/coreproto.pyx":177
 *         # self.schema = None
 *         self.version = None
 *         self.salt = None             # <<<<<<<<<<<<<<
 *         self.rbuf = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->salt);
  __Pyx_DECREF(__pyx_v_self->salt);
  __pyx_v_self->salt = ((PyObject*)Py_None);

  /* "asynctnt/iproto/coreproto.pyx":178
 *         self.version = None
 *         self.salt = None
 *         self.rbuf = None             # <<<<<<<<<<<<<<
 * 
 *         self._on_connection_lost(exc)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->rbuf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->rbuf));
  __pyx_v_self->rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)Py_None);

  /* "asynctnt/iproto/coreproto.pyx":180
 *         self.rbuf = None
 * 
 *         self._on_connection_lost(exc)             # <<<<<<<<<<<<<<
 */
  ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_connection_lost(__pyx_v_self, __pyx_v_exc);

  /* "asynctnt/iproto/coreproto.pyx":173
 *         self._on_connection_made()
 * 
 *     def connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         self.con_state = CONNECTION_BAD
 *         # self.schema = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_16__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_16__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.con_state, self.encoding, self.host, self.port, self.rbuf, self.salt, self.state, self.version)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(__pyx_v_self->con_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->encoding);
  __Pyx_GIVEREF(__pyx_v_self->encoding);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->encoding);
  __Pyx_INCREF(__pyx_v_self->host);
  __Pyx_GIVEREF(__pyx_v_self->host);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->host);
  __Pyx_INCREF(__pyx_v_self->port);
  __Pyx_GIVEREF(__pyx_v_self->port);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->port);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->rbuf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->rbuf));
  PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_v_self->rbuf));
  __Pyx_INCREF(__pyx_v_self->salt);
  __Pyx_GIVEREF(__pyx_v_self->salt);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_self->salt);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->version);
  __Pyx_GIVEREF(__pyx_v_self->version);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_self->version);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.con_state, self.encoding, self.host, self.port, self.rbuf, self.salt, self.state, self.version)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v__dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":7
 *     state = (self.con_state, self.encoding, self.host, self.port, self.rbuf, self.salt, self.state, self.version)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.encoding is not None or self.host is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.version is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.con_state, self.encoding, self.host, self.port, self.rbuf, self.salt, self.state, self.version)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.encoding is not None or self.host is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.version is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, None), state
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_self->encoding != ((PyObject*)Py_None));
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->host != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->port != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (((PyObject *)__pyx_v_self->rbuf) != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->salt != ((PyObject*)Py_None));
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->version != ((PyObject*)Py_None));
    __pyx_t_4 = (__pyx_t_6 != 0);
    __pyx_t_5 = __pyx_t_4;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_5;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.encoding is not None or self.host is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, None), state
 *     else:
 */
  __pyx_t_5 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":13
 *         use_setstate = self.encoding is not None or self.host is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.version is not None
 *     if use_setstate:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_253265777);
    __Pyx_GIVEREF(__pyx_int_253265777);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_253265777);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.encoding is not None or self.host is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, None), state
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_253265777);
    __Pyx_GIVEREF(__pyx_int_253265777);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_253265777);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_18__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12CoreProtocol_18__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_CoreProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xf188771, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.CoreProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":43
 * 
 * cdef class BaseProtocol(CoreProtocol):
 *     def __init__(self, host, port,             # <<<<<<<<<<<<<<
 *                  username, password,
 *                  fetch_schema,
 */

/* Python wrapper */
static int __pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_username = 0;
  PyObject *__pyx_v_password = 0;
  PyObject *__pyx_v_fetch_schema = 0;
  PyObject *__pyx_v_auto_refetch_schema = 0;
  PyObject *__pyx_v_connected_fut = 0;
  PyObject *__pyx_v_on_connection_made = 0;
  PyObject *__pyx_v_on_connection_lost = 0;
  PyObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_request_timeout = 0;
  PyObject *__pyx_v_encoding = 0;
  PyObject *__pyx_v_initial_read_buffer_size = 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_host,&__pyx_n_s_port,&__pyx_n_s_username,&__pyx_n_s_password,&__pyx_n_s_fetch_schema,&__pyx_n_s_auto_refetch_schema,&__pyx_n_s_connected_fut,&__pyx_n_s_on_connection_made,&__pyx_n_s_on_connection_lost,&__pyx_n_s_loop,&__pyx_n_s_request_timeout,&__pyx_n_s_encoding,&__pyx_n_s_initial_read_buffer_size,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};

    /* "asynctnt/iproto/protocol.pyx":50
 *                  on_connection_made, on_connection_lost,
 *                  loop,
 *                  request_timeout=None,             # <<<<<<<<<<<<<<
 *                  encoding=None,
 *                  initial_read_buffer_size=None):
 */
    values[10] = ((PyObject *)Py_None);

    /* "asynctnt/iproto/protocol.pyx":51
 *                  loop,
 *                  request_timeout=None,
 *                  encoding=None,             # <<<<<<<<<<<<<<
 *                  initial_read_buffer_size=None):
 *         CoreProtocol.__init__(self, host, port, encoding,
 */
    values[11] = ((PyObject *)Py_None);

    /* "asynctnt/iproto/protocol.pyx":52
 *                  request_timeout=None,
 *                  encoding=None,
 *                  initial_read_buffer_size=None):             # <<<<<<<<<<<<<<
 *         CoreProtocol.__init__(self, host, port, encoding,
 *                               initial_read_buffer_size)
 */
    values[12] = ((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 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 1); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_username)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 2); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 3); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fetch_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 4); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_auto_refetch_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 5); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_connected_fut)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 6); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_connection_made)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 7); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_connection_lost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 8); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, 9); __PYX_ERR(5, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_request_timeout);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initial_read_buffer_size);
          if (value) { values[12] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(5, 43, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 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_host = values[0];
    __pyx_v_port = values[1];
    __pyx_v_username = values[2];
    __pyx_v_password = values[3];
    __pyx_v_fetch_schema = values[4];
    __pyx_v_auto_refetch_schema = values[5];
    __pyx_v_connected_fut = values[6];
    __pyx_v_on_connection_made = values[7];
    __pyx_v_on_connection_lost = values[8];
    __pyx_v_loop = values[9];
    __pyx_v_request_timeout = values[10];
    __pyx_v_encoding = values[11];
    __pyx_v_initial_read_buffer_size = values[12];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 10, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 43, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol___init__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_username, __pyx_v_password, __pyx_v_fetch_schema, __pyx_v_auto_refetch_schema, __pyx_v_connected_fut, __pyx_v_on_connection_made, __pyx_v_on_connection_lost, __pyx_v_loop, __pyx_v_request_timeout, __pyx_v_encoding, __pyx_v_initial_read_buffer_size);

  /* "asynctnt/iproto/protocol.pyx":43
 * 
 * cdef class BaseProtocol(CoreProtocol):
 *     def __init__(self, host, port,             # <<<<<<<<<<<<<<
 *                  username, password,
 *                  fetch_schema,
 */

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

static int __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol___init__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_username, PyObject *__pyx_v_password, PyObject *__pyx_v_fetch_schema, PyObject *__pyx_v_auto_refetch_schema, PyObject *__pyx_v_connected_fut, PyObject *__pyx_v_on_connection_made, PyObject *__pyx_v_on_connection_lost, PyObject *__pyx_v_loop, PyObject *__pyx_v_request_timeout, PyObject *__pyx_v_encoding, PyObject *__pyx_v_initial_read_buffer_size) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  float __pyx_t_7;
  float __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "asynctnt/iproto/protocol.pyx":53
 *                  encoding=None,
 *                  initial_read_buffer_size=None):
 *         CoreProtocol.__init__(self, host, port, encoding,             # <<<<<<<<<<<<<<
 *                               initial_read_buffer_size)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_CoreProtocol), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/protocol.pyx":54
 *                  initial_read_buffer_size=None):
 *         CoreProtocol.__init__(self, host, port, encoding,
 *                               initial_read_buffer_size)             # <<<<<<<<<<<<<<
 * 
 *         self.loop = loop
 */
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_encoding, __pyx_v_initial_read_buffer_size};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_encoding, __pyx_v_initial_read_buffer_size};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_host);
    __Pyx_GIVEREF(__pyx_v_host);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_host);
    __Pyx_INCREF(__pyx_v_port);
    __Pyx_GIVEREF(__pyx_v_port);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_port);
    __Pyx_INCREF(__pyx_v_encoding);
    __Pyx_GIVEREF(__pyx_v_encoding);
    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_encoding);
    __Pyx_INCREF(__pyx_v_initial_read_buffer_size);
    __Pyx_GIVEREF(__pyx_v_initial_read_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_initial_read_buffer_size);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":56
 *                               initial_read_buffer_size)
 * 
 *         self.loop = loop             # <<<<<<<<<<<<<<
 * 
 *         self.username = username
 */
  __Pyx_INCREF(__pyx_v_loop);
  __Pyx_GIVEREF(__pyx_v_loop);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(__pyx_v_self->loop);
  __pyx_v_self->loop = __pyx_v_loop;

  /* "asynctnt/iproto/protocol.pyx":58
 *         self.loop = loop
 * 
 *         self.username = username             # <<<<<<<<<<<<<<
 *         self.password = password
 *         self.fetch_schema = fetch_schema
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_username))||((__pyx_v_username) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_username)->tp_name), 0))) __PYX_ERR(5, 58, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_username;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->username);
  __Pyx_DECREF(__pyx_v_self->username);
  __pyx_v_self->username = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":59
 * 
 *         self.username = username
 *         self.password = password             # <<<<<<<<<<<<<<
 *         self.fetch_schema = fetch_schema
 *         self.auto_refetch_schema = auto_refetch_schema
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_password))||((__pyx_v_password) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_password)->tp_name), 0))) __PYX_ERR(5, 59, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_password;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->password);
  __Pyx_DECREF(__pyx_v_self->password);
  __pyx_v_self->password = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":60
 *         self.username = username
 *         self.password = password
 *         self.fetch_schema = fetch_schema             # <<<<<<<<<<<<<<
 *         self.auto_refetch_schema = auto_refetch_schema
 *         self.request_timeout = request_timeout or 0
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_fetch_schema); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 60, __pyx_L1_error)
  __pyx_v_self->fetch_schema = __pyx_t_6;

  /* "asynctnt/iproto/protocol.pyx":61
 *         self.password = password
 *         self.fetch_schema = fetch_schema
 *         self.auto_refetch_schema = auto_refetch_schema             # <<<<<<<<<<<<<<
 *         self.request_timeout = request_timeout or 0
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_auto_refetch_schema); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 61, __pyx_L1_error)
  __pyx_v_self->auto_refetch_schema = __pyx_t_6;

  /* "asynctnt/iproto/protocol.pyx":62
 *         self.fetch_schema = fetch_schema
 *         self.auto_refetch_schema = auto_refetch_schema
 *         self.request_timeout = request_timeout or 0             # <<<<<<<<<<<<<<
 * 
 *         self.connected_fut = connected_fut
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_request_timeout); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(5, 62, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_request_timeout); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 62, __pyx_L1_error)
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_self->request_timeout = __pyx_t_7;

  /* "asynctnt/iproto/protocol.pyx":64
 *         self.request_timeout = request_timeout or 0
 * 
 *         self.connected_fut = connected_fut             # <<<<<<<<<<<<<<
 *         self.on_connection_made_cb = on_connection_made
 *         self.on_connection_lost_cb = on_connection_lost
 */
  __Pyx_INCREF(__pyx_v_connected_fut);
  __Pyx_GIVEREF(__pyx_v_connected_fut);
  __Pyx_GOTREF(__pyx_v_self->connected_fut);
  __Pyx_DECREF(__pyx_v_self->connected_fut);
  __pyx_v_self->connected_fut = __pyx_v_connected_fut;

  /* "asynctnt/iproto/protocol.pyx":65
 * 
 *         self.connected_fut = connected_fut
 *         self.on_connection_made_cb = on_connection_made             # <<<<<<<<<<<<<<
 *         self.on_connection_lost_cb = on_connection_lost
 *         self._closing = False
 */
  __Pyx_INCREF(__pyx_v_on_connection_made);
  __Pyx_GIVEREF(__pyx_v_on_connection_made);
  __Pyx_GOTREF(__pyx_v_self->on_connection_made_cb);
  __Pyx_DECREF(__pyx_v_self->on_connection_made_cb);
  __pyx_v_self->on_connection_made_cb = __pyx_v_on_connection_made;

  /* "asynctnt/iproto/protocol.pyx":66
 *         self.connected_fut = connected_fut
 *         self.on_connection_made_cb = on_connection_made
 *         self.on_connection_lost_cb = on_connection_lost             # <<<<<<<<<<<<<<
 *         self._closing = False
 * 
 */
  __Pyx_INCREF(__pyx_v_on_connection_lost);
  __Pyx_GIVEREF(__pyx_v_on_connection_lost);
  __Pyx_GOTREF(__pyx_v_self->on_connection_lost_cb);
  __Pyx_DECREF(__pyx_v_self->on_connection_lost_cb);
  __pyx_v_self->on_connection_lost_cb = __pyx_v_on_connection_lost;

  /* "asynctnt/iproto/protocol.pyx":67
 *         self.on_connection_made_cb = on_connection_made
 *         self.on_connection_lost_cb = on_connection_lost
 *         self._closing = False             # <<<<<<<<<<<<<<
 * 
 *         self._on_request_completed_cb = self._on_request_completed
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closing, Py_False) < 0) __PYX_ERR(5, 67, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":69
 *         self._closing = False
 * 
 *         self._on_request_completed_cb = self._on_request_completed             # <<<<<<<<<<<<<<
 *         self._on_request_timeout_cb = self._on_request_timeout
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_request_completed); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_on_request_completed_cb);
  __Pyx_DECREF(__pyx_v_self->_on_request_completed_cb);
  __pyx_v_self->_on_request_completed_cb = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":70
 * 
 *         self._on_request_completed_cb = self._on_request_completed
 *         self._on_request_timeout_cb = self._on_request_timeout             # <<<<<<<<<<<<<<
 * 
 *         self._reqs = {}
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_request_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_on_request_timeout_cb);
  __Pyx_DECREF(__pyx_v_self->_on_request_timeout_cb);
  __pyx_v_self->_on_request_timeout_cb = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":72
 *         self._on_request_timeout_cb = self._on_request_timeout
 * 
 *         self._reqs = {}             # <<<<<<<<<<<<<<
 *         self._sync = 0
 *         self._schema_id = -1
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_reqs);
  __Pyx_DECREF(__pyx_v_self->_reqs);
  __pyx_v_self->_reqs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":73
 * 
 *         self._reqs = {}
 *         self._sync = 0             # <<<<<<<<<<<<<<
 *         self._schema_id = -1
 *         self._schema = Schema.__new__(Schema, self._schema_id)
 */
  __pyx_v_self->_sync = 0;

  /* "asynctnt/iproto/protocol.pyx":74
 *         self._reqs = {}
 *         self._sync = 0
 *         self._schema_id = -1             # <<<<<<<<<<<<<<
 *         self._schema = Schema.__new__(Schema, self._schema_id)
 *         self._schema_fetch_in_progress = False
 */
  __pyx_v_self->_schema_id = -1L;

  /* "asynctnt/iproto/protocol.pyx":75
 *         self._sync = 0
 *         self._schema_id = -1
 *         self._schema = Schema.__new__(Schema, self._schema_id)             # <<<<<<<<<<<<<<
 *         self._schema_fetch_in_progress = False
 *         self._refetch_schema_future = None
 */
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_schema_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 75, __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 = 0;
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_Schema(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_Schema), __pyx_t_2, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 75, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_schema));
  __pyx_v_self->_schema = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":76
 *         self._schema_id = -1
 *         self._schema = Schema.__new__(Schema, self._schema_id)
 *         self._schema_fetch_in_progress = False             # <<<<<<<<<<<<<<
 *         self._refetch_schema_future = None
 *         self._db = self._create_db()
 */
  __pyx_v_self->_schema_fetch_in_progress = 0;

  /* "asynctnt/iproto/protocol.pyx":77
 *         self._schema = Schema.__new__(Schema, self._schema_id)
 *         self._schema_fetch_in_progress = False
 *         self._refetch_schema_future = None             # <<<<<<<<<<<<<<
 *         self._db = self._create_db()
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_refetch_schema_future);
  __Pyx_DECREF(__pyx_v_self->_refetch_schema_future);
  __pyx_v_self->_refetch_schema_future = Py_None;

  /* "asynctnt/iproto/protocol.pyx":78
 *         self._schema_fetch_in_progress = False
 *         self._refetch_schema_future = None
 *         self._db = self._create_db()             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_create_db(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_db);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_db));
  __pyx_v_self->_db = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":80
 *         self._db = self._create_db()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self.create_future = self.loop.create_future
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "asynctnt/iproto/protocol.pyx":81
 * 
 *         try:
 *             self.create_future = self.loop.create_future             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             self.create_future = self._create_future_fallback
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_create_future); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 81, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->create_future);
      __Pyx_DECREF(__pyx_v_self->create_future);
      __pyx_v_self->create_future = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "asynctnt/iproto/protocol.pyx":80
 *         self._db = self._create_db()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self.create_future = self.loop.create_future
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L10_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asynctnt/iproto/protocol.pyx":82
 *         try:
 *             self.create_future = self.loop.create_future
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             self.create_future = self._create_future_fallback
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_4) {
      __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(5, 82, __pyx_L7_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_5);

      /* "asynctnt/iproto/protocol.pyx":83
 *             self.create_future = self.loop.create_future
 *         except AttributeError:
 *             self.create_future = self._create_future_fallback             # <<<<<<<<<<<<<<
 * 
 *     def _create_future_fallback(self):  # pragma: nocover
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_future_fallback); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 83, __pyx_L7_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->create_future);
      __Pyx_DECREF(__pyx_v_self->create_future);
      __pyx_v_self->create_future = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L6_exception_handled;
    }
    goto __pyx_L7_except_error;
    __pyx_L7_except_error:;

    /* "asynctnt/iproto/protocol.pyx":80
 *         self._db = self._create_db()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self.create_future = self.loop.create_future
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L10_try_end:;
  }

  /* "asynctnt/iproto/protocol.pyx":43
 * 
 * cdef class BaseProtocol(CoreProtocol):
 *     def __init__(self, host, port,             # <<<<<<<<<<<<<<
 *                  username, password,
 *                  fetch_schema,
 */

  /* function exit code */
  __pyx_r = 0;
  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_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":85
 *             self.create_future = self._create_future_fallback
 * 
 *     def _create_future_fallback(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         return asyncio.Future(loop=self.loop)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_3_create_future_fallback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_3_create_future_fallback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_future_fallback (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_2_create_future_fallback(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_2_create_future_fallback(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__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("_create_future_fallback", 0);

  /* "asynctnt/iproto/protocol.pyx":86
 * 
 *     def _create_future_fallback(self):  # pragma: nocover
 *         return asyncio.Future(loop=self.loop)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Future); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_loop, __pyx_v_self->loop) < 0) __PYX_ERR(5, 86, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":85
 *             self.create_future = self._create_future_fallback
 * 
 *     def _create_future_fallback(self):  # pragma: nocover             # <<<<<<<<<<<<<<
 *         return asyncio.Future(loop=self.loop)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._create_future_fallback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":89
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         return self._schema
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_6schema___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_6schema___get__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "asynctnt/iproto/protocol.pyx":90
 *     @property
 *     def schema(self):
 *         return self._schema             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_schema));
  __pyx_r = ((PyObject *)__pyx_v_self->_schema);
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":89
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         return self._schema
 * 
 */

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

/* "asynctnt/iproto/protocol.pyx":93
 * 
 *     @property
 *     def schema_id(self):             # <<<<<<<<<<<<<<
 *         return self._schema_id
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_9schema_id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_9schema_id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_9schema_id___get__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/protocol.pyx":94
 *     @property
 *     def schema_id(self):
 *         return self._schema_id             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_connection_ready(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_schema_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":93
 * 
 *     @property
 *     def schema_id(self):             # <<<<<<<<<<<<<<
 *         return self._schema_id
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.schema_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":96
 *         return self._schema_id
 * 
 *     cdef void _set_connection_ready(self):             # <<<<<<<<<<<<<<
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_result(True)
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__set_connection_ready(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_connection_ready", 0);

  /* "asynctnt/iproto/protocol.pyx":97
 * 
 *     cdef void _set_connection_ready(self):
 *         if not self.connected_fut.done():             # <<<<<<<<<<<<<<
 *             self.connected_fut.set_result(True)
 *             self.con_state = CONNECTION_FULL
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connected_fut, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "asynctnt/iproto/protocol.pyx":98
 *     cdef void _set_connection_ready(self):
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_result(True)             # <<<<<<<<<<<<<<
 *             self.con_state = CONNECTION_FULL
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connected_fut, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, Py_True) : __Pyx_PyObject_CallOneArg(__pyx_t_2, Py_True);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 98, __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;

    /* "asynctnt/iproto/protocol.pyx":99
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_result(True)
 *             self.con_state = CONNECTION_FULL             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_connection_error(self, e):
 */
    __pyx_v_self->__pyx_base.con_state = __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_FULL;

    /* "asynctnt/iproto/protocol.pyx":97
 * 
 *     cdef void _set_connection_ready(self):
 *         if not self.connected_fut.done():             # <<<<<<<<<<<<<<
 *             self.connected_fut.set_result(True)
 *             self.con_state = CONNECTION_FULL
 */
  }

  /* "asynctnt/iproto/protocol.pyx":96
 *         return self._schema_id
 * 
 *     cdef void _set_connection_ready(self):             # <<<<<<<<<<<<<<
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_result(True)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._set_connection_ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":101
 *             self.con_state = CONNECTION_FULL
 * 
 *     cdef void _set_connection_error(self, e):             # <<<<<<<<<<<<<<
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_exception(e)
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__set_connection_error(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_e) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_connection_error", 0);

  /* "asynctnt/iproto/protocol.pyx":102
 * 
 *     cdef void _set_connection_error(self, e):
 *         if not self.connected_fut.done():             # <<<<<<<<<<<<<<
 *             self.connected_fut.set_exception(e)
 *             self.con_state = CONNECTION_BAD
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connected_fut, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "asynctnt/iproto/protocol.pyx":103
 *     cdef void _set_connection_error(self, e):
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_exception(e)             # <<<<<<<<<<<<<<
 *             self.con_state = CONNECTION_BAD
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connected_fut, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_e);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 103, __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;

    /* "asynctnt/iproto/protocol.pyx":104
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_exception(e)
 *             self.con_state = CONNECTION_BAD             # <<<<<<<<<<<<<<
 * 
 *     cdef void _on_greeting_received(self):
 */
    __pyx_v_self->__pyx_base.con_state = __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_BAD;

    /* "asynctnt/iproto/protocol.pyx":102
 * 
 *     cdef void _set_connection_error(self, e):
 *         if not self.connected_fut.done():             # <<<<<<<<<<<<<<
 *             self.connected_fut.set_exception(e)
 *             self.con_state = CONNECTION_BAD
 */
  }

  /* "asynctnt/iproto/protocol.pyx":101
 *             self.con_state = CONNECTION_FULL
 * 
 *     cdef void _set_connection_error(self, e):             # <<<<<<<<<<<<<<
 *         if not self.connected_fut.done():
 *             self.connected_fut.set_exception(e)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._set_connection_error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":106
 *             self.con_state = CONNECTION_BAD
 * 
 *     cdef void _on_greeting_received(self):             # <<<<<<<<<<<<<<
 *         if self.username and self.password:
 *             self._do_auth(self.username, self.password)
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_greeting_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  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("_on_greeting_received", 0);

  /* "asynctnt/iproto/protocol.pyx":107
 * 
 *     cdef void _on_greeting_received(self):
 *         if self.username and self.password:             # <<<<<<<<<<<<<<
 *             self._do_auth(self.username, self.password)
 *         elif self.fetch_schema:
 */
  __pyx_t_2 = (__pyx_v_self->username != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_self->username) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->password != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_self->password) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asynctnt/iproto/protocol.pyx":108
 *     cdef void _on_greeting_received(self):
 *         if self.username and self.password:
 *             self._do_auth(self.username, self.password)             # <<<<<<<<<<<<<<
 *         elif self.fetch_schema:
 *             self._refetch_schema()
 */
    __pyx_t_3 = __pyx_v_self->username;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_v_self->password;
    __Pyx_INCREF(__pyx_t_4);
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_do_auth(__pyx_v_self, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asynctnt/iproto/protocol.pyx":107
 * 
 *     cdef void _on_greeting_received(self):
 *         if self.username and self.password:             # <<<<<<<<<<<<<<
 *             self._do_auth(self.username, self.password)
 *         elif self.fetch_schema:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/protocol.pyx":109
 *         if self.username and self.password:
 *             self._do_auth(self.username, self.password)
 *         elif self.fetch_schema:             # <<<<<<<<<<<<<<
 *             self._refetch_schema()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->fetch_schema != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/protocol.pyx":110
 *             self._do_auth(self.username, self.password)
 *         elif self.fetch_schema:
 *             self._refetch_schema()             # <<<<<<<<<<<<<<
 *         else:
 *             self._set_connection_ready()
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_refetch_schema(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asynctnt/iproto/protocol.pyx":109
 *         if self.username and self.password:
 *             self._do_auth(self.username, self.password)
 *         elif self.fetch_schema:             # <<<<<<<<<<<<<<
 *             self._refetch_schema()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "asynctnt/iproto/protocol.pyx":112
 *             self._refetch_schema()
 *         else:
 *             self._set_connection_ready()             # <<<<<<<<<<<<<<
 * 
 *     cdef void _on_response_received(self, const char *buf, uint32_t buf_len):
 */
  /*else*/ {
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_ready(__pyx_v_self);
  }
  __pyx_L3:;

  /* "asynctnt/iproto/protocol.pyx":106
 *             self.con_state = CONNECTION_BAD
 * 
 *     cdef void _on_greeting_received(self):             # <<<<<<<<<<<<<<
 *         if self.username and self.password:
 *             self._do_auth(self.username, self.password)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._on_greeting_received", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":114
 *             self._set_connection_ready()
 * 
 *     cdef void _on_response_received(self, const char *buf, uint32_t buf_len):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject *req_p
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_response_received(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, char const *__pyx_v_buf, uint32_t __pyx_v_buf_len) {
  PyObject *__pyx_v_req_p;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req = 0;
  struct __pyx_t_8asynctnt_6iproto_8protocol_Header __pyx_v_hdr;
  int __pyx_v_is_chunk;
  PyObject *__pyx_v_waiter = 0;
  PyObject *__pyx_v_sync_obj = 0;
  PyObject *__pyx_v_err = 0;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_e = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  uint64_t __pyx_t_9;
  int64_t __pyx_t_10;
  int32_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_response_received", 0);

  /* "asynctnt/iproto/protocol.pyx":126
 *             ssize_t length
 * 
 *         length = response_parse_header(buf, buf_len, &hdr)             # <<<<<<<<<<<<<<
 *         buf_len -= length
 *         buf = &buf[length]  # skip header
 */
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_response_parse_header(__pyx_v_buf, __pyx_v_buf_len, (&__pyx_v_hdr)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 126, __pyx_L1_error)
  __pyx_v_length = __pyx_t_1;

  /* "asynctnt/iproto/protocol.pyx":127
 * 
 *         length = response_parse_header(buf, buf_len, &hdr)
 *         buf_len -= length             # <<<<<<<<<<<<<<
 *         buf = &buf[length]  # skip header
 * 
 */
  __pyx_v_buf_len = (__pyx_v_buf_len - __pyx_v_length);

  /* "asynctnt/iproto/protocol.pyx":128
 *         length = response_parse_header(buf, buf_len, &hdr)
 *         buf_len -= length
 *         buf = &buf[length]  # skip header             # <<<<<<<<<<<<<<
 * 
 *         sync_obj = <object> hdr.sync
 */
  __pyx_v_buf = (&(__pyx_v_buf[__pyx_v_length]));

  /* "asynctnt/iproto/protocol.pyx":130
 *         buf = &buf[length]  # skip header
 * 
 *         sync_obj = <object> hdr.sync             # <<<<<<<<<<<<<<
 * 
 *         req_p = cpython.dict.PyDict_GetItem(self._reqs, sync_obj)
 */
  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_hdr.sync); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sync_obj = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asynctnt/iproto/protocol.pyx":132
 *         sync_obj = <object> hdr.sync
 * 
 *         req_p = cpython.dict.PyDict_GetItem(self._reqs, sync_obj)             # <<<<<<<<<<<<<<
 *         if req_p is NULL:
 *             logger.warning('sync %d not found', hdr.sync)
 */
  __pyx_t_3 = __pyx_v_self->_reqs;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_req_p = PyDict_GetItem(__pyx_t_3, __pyx_v_sync_obj);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asynctnt/iproto/protocol.pyx":133
 * 
 *         req_p = cpython.dict.PyDict_GetItem(self._reqs, sync_obj)
 *         if req_p is NULL:             # <<<<<<<<<<<<<<
 *             logger.warning('sync %d not found', hdr.sync)
 *             return
 */
  __pyx_t_4 = ((__pyx_v_req_p == NULL) != 0);
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":134
 *         req_p = cpython.dict.PyDict_GetItem(self._reqs, sync_obj)
 *         if req_p is NULL:
 *             logger.warning('sync %d not found', hdr.sync)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_hdr.sync); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(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_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_sync_d_not_found, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 134, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_sync_d_not_found, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 134, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 134, __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_sync_d_not_found);
      __Pyx_GIVEREF(__pyx_kp_u_sync_d_not_found);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_sync_d_not_found);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 134, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asynctnt/iproto/protocol.pyx":135
 *         if req_p is NULL:
 *             logger.warning('sync %d not found', hdr.sync)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         is_chunk = (hdr.code == tarantool.IPROTO_CHUNK)
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":133
 * 
 *         req_p = cpython.dict.PyDict_GetItem(self._reqs, sync_obj)
 *         if req_p is NULL:             # <<<<<<<<<<<<<<
 *             logger.warning('sync %d not found', hdr.sync)
 *             return
 */
  }

  /* "asynctnt/iproto/protocol.pyx":137
 *             return
 * 
 *         is_chunk = (hdr.code == tarantool.IPROTO_CHUNK)             # <<<<<<<<<<<<<<
 * 
 *         req = <Request> req_p
 */
  __pyx_v_is_chunk = (__pyx_v_hdr.code == __pyx_e_8asynctnt_6iproto_9tarantool_IPROTO_CHUNK);

  /* "asynctnt/iproto/protocol.pyx":139
 *         is_chunk = (hdr.code == tarantool.IPROTO_CHUNK)
 * 
 *         req = <Request> req_p             # <<<<<<<<<<<<<<
 *         req.response._sync = hdr.sync
 *         req.response._schema_id = hdr.schema_id
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_req_p);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_req = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asynctnt/iproto/protocol.pyx":140
 * 
 *         req = <Request> req_p
 *         req.response._sync = hdr.sync             # <<<<<<<<<<<<<<
 *         req.response._schema_id = hdr.schema_id
 *         if not is_chunk:
 */
  __pyx_t_9 = __pyx_v_hdr.sync;
  __pyx_v_req->response->_sync = __pyx_t_9;

  /* "asynctnt/iproto/protocol.pyx":141
 *         req = <Request> req_p
 *         req.response._sync = hdr.sync
 *         req.response._schema_id = hdr.schema_id             # <<<<<<<<<<<<<<
 *         if not is_chunk:
 *             req.response._code = hdr.code
 */
  __pyx_t_10 = __pyx_v_hdr.schema_id;
  __pyx_v_req->response->_schema_id = __pyx_t_10;

  /* "asynctnt/iproto/protocol.pyx":142
 *         req.response._sync = hdr.sync
 *         req.response._schema_id = hdr.schema_id
 *         if not is_chunk:             # <<<<<<<<<<<<<<
 *             req.response._code = hdr.code
 *             req.response._return_code = hdr.return_code
 */
  __pyx_t_4 = ((!(__pyx_v_is_chunk != 0)) != 0);
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":143
 *         req.response._schema_id = hdr.schema_id
 *         if not is_chunk:
 *             req.response._code = hdr.code             # <<<<<<<<<<<<<<
 *             req.response._return_code = hdr.return_code
 *             cpython.dict.PyDict_DelItem(self._reqs, sync_obj)
 */
    __pyx_t_11 = __pyx_v_hdr.code;
    __pyx_v_req->response->_code = __pyx_t_11;

    /* "asynctnt/iproto/protocol.pyx":144
 *         if not is_chunk:
 *             req.response._code = hdr.code
 *             req.response._return_code = hdr.return_code             # <<<<<<<<<<<<<<
 *             cpython.dict.PyDict_DelItem(self._reqs, sync_obj)
 *         else:
 */
    __pyx_t_11 = __pyx_v_hdr.return_code;
    __pyx_v_req->response->_return_code = __pyx_t_11;

    /* "asynctnt/iproto/protocol.pyx":145
 *             req.response._code = hdr.code
 *             req.response._return_code = hdr.return_code
 *             cpython.dict.PyDict_DelItem(self._reqs, sync_obj)             # <<<<<<<<<<<<<<
 *         else:
 *             if not req.push_subscribe:
 */
    __pyx_t_3 = __pyx_v_self->_reqs;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyDict_DelItem(__pyx_t_3, __pyx_v_sync_obj); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 145, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asynctnt/iproto/protocol.pyx":142
 *         req.response._sync = hdr.sync
 *         req.response._schema_id = hdr.schema_id
 *         if not is_chunk:             # <<<<<<<<<<<<<<
 *             req.response._code = hdr.code
 *             req.response._return_code = hdr.return_code
 */
    goto __pyx_L4;
  }

  /* "asynctnt/iproto/protocol.pyx":147
 *             cpython.dict.PyDict_DelItem(self._reqs, sync_obj)
 *         else:
 *             if not req.push_subscribe:             # <<<<<<<<<<<<<<
 *                 # skip request data as no one will be waiting for it
 *                 mp_next(&buf)
 */
  /*else*/ {
    __pyx_t_4 = ((!(__pyx_v_req->push_subscribe != 0)) != 0);
    if (__pyx_t_4) {

      /* "asynctnt/iproto/protocol.pyx":149
 *             if not req.push_subscribe:
 *                 # skip request data as no one will be waiting for it
 *                 mp_next(&buf)             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
      mp_next((&__pyx_v_buf));

      /* "asynctnt/iproto/protocol.pyx":150
 *                 # skip request data as no one will be waiting for it
 *                 mp_next(&buf)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         err = None
 */
      goto __pyx_L0;

      /* "asynctnt/iproto/protocol.pyx":147
 *             cpython.dict.PyDict_DelItem(self._reqs, sync_obj)
 *         else:
 *             if not req.push_subscribe:             # <<<<<<<<<<<<<<
 *                 # skip request data as no one will be waiting for it
 *                 mp_next(&buf)
 */
    }
  }
  __pyx_L4:;

  /* "asynctnt/iproto/protocol.pyx":152
 *                 return
 * 
 *         err = None             # <<<<<<<<<<<<<<
 *         if buf != &buf[buf_len]:
 *             # has body
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_err = Py_None;

  /* "asynctnt/iproto/protocol.pyx":153
 * 
 *         err = None
 *         if buf != &buf[buf_len]:             # <<<<<<<<<<<<<<
 *             # has body
 *             try:
 */
  __pyx_t_4 = ((__pyx_v_buf != (&(__pyx_v_buf[__pyx_v_buf_len]))) != 0);
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":155
 *         if buf != &buf[buf_len]:
 *             # has body
 *             try:             # <<<<<<<<<<<<<<
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)
 *             except Exception as e:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      /*try:*/ {

        /* "asynctnt/iproto/protocol.pyx":156
 *             # has body
 *             try:
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 err = e
 */
        __pyx_t_3 = ((PyObject *)__pyx_v_req->response);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol_response_parse_body(__pyx_v_buf, __pyx_v_buf_len, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_t_3), __pyx_v_req, __pyx_v_is_chunk); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 156, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asynctnt/iproto/protocol.pyx":155
 *         if buf != &buf[buf_len]:
 *             # has body
 *             try:             # <<<<<<<<<<<<<<
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)
 *             except Exception as e:
 */
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L12_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asynctnt/iproto/protocol.pyx":157
 *             try:
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 err = e
 * 
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_7) {
        __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._on_response_received", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(5, 157, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_v_e = __pyx_t_5;
        /*try:*/ {

          /* "asynctnt/iproto/protocol.pyx":158
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)
 *             except Exception as e:
 *                 err = e             # <<<<<<<<<<<<<<
 * 
 *         # refetch schema if it is changed
 */
          __Pyx_INCREF(__pyx_v_e);
          __Pyx_DECREF_SET(__pyx_v_err, __pyx_v_e);
        }

        /* "asynctnt/iproto/protocol.pyx":157
 *             try:
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 err = e
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
            goto __pyx_L19;
          }
          __pyx_L19:;
        }
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L8_exception_handled;
      }
      goto __pyx_L9_except_error;
      __pyx_L9_except_error:;

      /* "asynctnt/iproto/protocol.pyx":155
 *         if buf != &buf[buf_len]:
 *             # has body
 *             try:             # <<<<<<<<<<<<<<
 *                 response_parse_body(buf, buf_len, req.response, req, is_chunk)
 *             except Exception as e:
 */
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_L12_try_end:;
    }

    /* "asynctnt/iproto/protocol.pyx":153
 * 
 *         err = None
 *         if buf != &buf[buf_len]:             # <<<<<<<<<<<<<<
 *             # has body
 *             try:
 */
  }

  /* "asynctnt/iproto/protocol.pyx":161
 * 
 *         # refetch schema if it is changed
 *         if self.auto_refetch_schema \             # <<<<<<<<<<<<<<
 *                 and req.response._schema_id > 0 \
 *                 and req.response._schema_id != self._schema_id:
 */
  __pyx_t_15 = (__pyx_v_self->auto_refetch_schema != 0);
  if (__pyx_t_15) {
  } else {
    __pyx_t_4 = __pyx_t_15;
    goto __pyx_L21_bool_binop_done;
  }

  /* "asynctnt/iproto/protocol.pyx":162
 *         # refetch schema if it is changed
 *         if self.auto_refetch_schema \
 *                 and req.response._schema_id > 0 \             # <<<<<<<<<<<<<<
 *                 and req.response._schema_id != self._schema_id:
 *             self._refetch_schema()
 */
  __pyx_t_15 = ((__pyx_v_req->response->_schema_id > 0) != 0);
  if (__pyx_t_15) {
  } else {
    __pyx_t_4 = __pyx_t_15;
    goto __pyx_L21_bool_binop_done;
  }

  /* "asynctnt/iproto/protocol.pyx":163
 *         if self.auto_refetch_schema \
 *                 and req.response._schema_id > 0 \
 *                 and req.response._schema_id != self._schema_id:             # <<<<<<<<<<<<<<
 *             self._refetch_schema()
 * 
 */
  __pyx_t_15 = ((__pyx_v_req->response->_schema_id != __pyx_v_self->_schema_id) != 0);
  __pyx_t_4 = __pyx_t_15;
  __pyx_L21_bool_binop_done:;

  /* "asynctnt/iproto/protocol.pyx":161
 * 
 *         # refetch schema if it is changed
 *         if self.auto_refetch_schema \             # <<<<<<<<<<<<<<
 *                 and req.response._schema_id > 0 \
 *                 and req.response._schema_id != self._schema_id:
 */
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":164
 *                 and req.response._schema_id > 0 \
 *                 and req.response._schema_id != self._schema_id:
 *             self._refetch_schema()             # <<<<<<<<<<<<<<
 * 
 *         # returning result
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_refetch_schema(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asynctnt/iproto/protocol.pyx":161
 * 
 *         # refetch schema if it is changed
 *         if self.auto_refetch_schema \             # <<<<<<<<<<<<<<
 *                 and req.response._schema_id > 0 \
 *                 and req.response._schema_id != self._schema_id:
 */
  }

  /* "asynctnt/iproto/protocol.pyx":167
 * 
 *         # returning result
 *         if is_chunk:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_4 = (__pyx_v_is_chunk != 0);
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":168
 *         # returning result
 *         if is_chunk:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         waiter = req.waiter
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":167
 * 
 *         # returning result
 *         if is_chunk:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":170
 *             return
 * 
 *         waiter = req.waiter             # <<<<<<<<<<<<<<
 *         if waiter is None or waiter.done():
 *             return
 */
  __pyx_t_8 = __pyx_v_req->waiter;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_v_waiter = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "asynctnt/iproto/protocol.pyx":171
 * 
 *         waiter = req.waiter
 *         if waiter is None or waiter.done():             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_15 = (__pyx_v_waiter == Py_None);
  __pyx_t_16 = (__pyx_t_15 != 0);
  if (!__pyx_t_16) {
  } else {
    __pyx_t_4 = __pyx_t_16;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_4 = __pyx_t_16;
  __pyx_L26_bool_binop_done:;
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":172
 *         waiter = req.waiter
 *         if waiter is None or waiter.done():
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if err is not None:
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":171
 * 
 *         waiter = req.waiter
 *         if waiter is None or waiter.done():             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":174
 *             return
 * 
 *         if err is not None:             # <<<<<<<<<<<<<<
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)
 */
  __pyx_t_4 = (__pyx_v_err != Py_None);
  __pyx_t_16 = (__pyx_t_4 != 0);
  if (__pyx_t_16) {

    /* "asynctnt/iproto/protocol.pyx":175
 * 
 *         if err is not None:
 *             req.response.set_exception(err)             # <<<<<<<<<<<<<<
 *             waiter.set_exception(err)
 *             return
 */
    __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception(__pyx_v_req->response, __pyx_v_err);

    /* "asynctnt/iproto/protocol.pyx":176
 *         if err is not None:
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_err) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_err);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asynctnt/iproto/protocol.pyx":177
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if req.response.is_error():
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":174
 *             return
 * 
 *         if err is not None:             # <<<<<<<<<<<<<<
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)
 */
  }

  /* "asynctnt/iproto/protocol.pyx":179
 *             return
 * 
 *         if req.response.is_error():             # <<<<<<<<<<<<<<
 *             err = TarantoolDatabaseError(req.response._return_code,
 *                                          req.response._errmsg)
 */
  __pyx_t_16 = (__pyx_f_8asynctnt_6iproto_8protocol_8Response_is_error(__pyx_v_req->response) != 0);
  if (__pyx_t_16) {

    /* "asynctnt/iproto/protocol.pyx":180
 * 
 *         if req.response.is_error():
 *             err = TarantoolDatabaseError(req.response._return_code,             # <<<<<<<<<<<<<<
 *                                          req.response._errmsg)
 *             req.response.set_exception(err)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TarantoolDatabaseError); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_req->response->_return_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asynctnt/iproto/protocol.pyx":181
 *         if req.response.is_error():
 *             err = TarantoolDatabaseError(req.response._return_code,
 *                                          req.response._errmsg)             # <<<<<<<<<<<<<<
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)
 */
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_req->response->_errmsg};
      __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 180, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_req->response->_errmsg};
      __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 180, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
      __Pyx_INCREF(__pyx_v_req->response->_errmsg);
      __Pyx_GIVEREF(__pyx_v_req->response->_errmsg);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_req->response->_errmsg);
      __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_err, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "asynctnt/iproto/protocol.pyx":182
 *             err = TarantoolDatabaseError(req.response._return_code,
 *                                          req.response._errmsg)
 *             req.response.set_exception(err)             # <<<<<<<<<<<<<<
 *             waiter.set_exception(err)
 *             return
 */
    __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception(__pyx_v_req->response, __pyx_v_err);

    /* "asynctnt/iproto/protocol.pyx":183
 *                                          req.response._errmsg)
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_err) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_err);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asynctnt/iproto/protocol.pyx":184
 *             req.response.set_exception(err)
 *             waiter.set_exception(err)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         waiter.set_result(req.response)
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":179
 *             return
 * 
 *         if req.response.is_error():             # <<<<<<<<<<<<<<
 *             err = TarantoolDatabaseError(req.response._return_code,
 *                                          req.response._errmsg)
 */
  }

  /* "asynctnt/iproto/protocol.pyx":186
 *             return
 * 
 *         waiter.set_result(req.response)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _do_auth(self, str username, str password):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_v_req->response)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_req->response));
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "asynctnt/iproto/protocol.pyx":114
 *             self._set_connection_ready()
 * 
 *     cdef void _on_response_received(self, const char *buf, uint32_t buf_len):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject *req_p
 */

  /* function exit code */
  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_8);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._on_response_received", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
  __Pyx_XDECREF(__pyx_v_waiter);
  __Pyx_XDECREF(__pyx_v_sync_obj);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":192
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 * 
 *         def on_authorized(f):             # <<<<<<<<<<<<<<
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_1on_authorized(PyObject *__pyx_self, PyObject *__pyx_v_f); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_1on_authorized = {"on_authorized", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_1on_authorized, METH_O, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_1on_authorized(PyObject *__pyx_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_authorized (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_on_authorized(__pyx_self, ((PyObject *)__pyx_v_f));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_on_authorized(PyObject *__pyx_self, PyObject *__pyx_v_f) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *__pyx_cur_scope;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *__pyx_outer_scope;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __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("on_authorized", 0);
  __pyx_outer_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "asynctnt/iproto/protocol.pyx":193
 * 
 *         def on_authorized(f):
 *             if f.cancelled():             # <<<<<<<<<<<<<<
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_cancelled); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":194
 *         def on_authorized(f):
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())             # <<<<<<<<<<<<<<
 *                 return
 *             e = f.exception()
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 194, __pyx_L1_error) }
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_futures); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 194, __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_CancelledError); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_error(__pyx_cur_scope->__pyx_v_self, __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":195
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return             # <<<<<<<<<<<<<<
 *             e = f.exception()
 *             if not e:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":193
 * 
 *         def on_authorized(f):
 *             if f.cancelled():             # <<<<<<<<<<<<<<
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return
 */
  }

  /* "asynctnt/iproto/protocol.pyx":196
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return
 *             e = f.exception()             # <<<<<<<<<<<<<<
 *             if not e:
 *                 logger.debug('Tarantool[%s:%s] Authorized successfully',
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":197
 *                 return
 *             e = f.exception()
 *             if not e:             # <<<<<<<<<<<<<<
 *                 logger.debug('Tarantool[%s:%s] Authorized successfully',
 *                              self.host, self.port)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_e); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 197, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "asynctnt/iproto/protocol.pyx":198
 *             e = f.exception()
 *             if not e:
 *                 logger.debug('Tarantool[%s:%s] Authorized successfully',             # <<<<<<<<<<<<<<
 *                              self.host, self.port)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asynctnt/iproto/protocol.pyx":199
 *             if not e:
 *                 logger.debug('Tarantool[%s:%s] Authorized successfully',
 *                              self.host, self.port)             # <<<<<<<<<<<<<<
 * 
 *                 if self.fetch_schema:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 199, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 199, __pyx_L1_error) }
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Tarantool_s_s_Authorized_success, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 198, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_kp_u_Tarantool_s_s_Authorized_success, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 198, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_Tarantool_s_s_Authorized_success);
      __Pyx_GIVEREF(__pyx_kp_u_Tarantool_s_s_Authorized_success);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_u_Tarantool_s_s_Authorized_success);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":201
 *                              self.host, self.port)
 * 
 *                 if self.fetch_schema:             # <<<<<<<<<<<<<<
 *                     self._do_fetch_schema(None)
 *                 else:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 201, __pyx_L1_error) }
    __pyx_t_5 = (__pyx_cur_scope->__pyx_v_self->fetch_schema != 0);
    if (__pyx_t_5) {

      /* "asynctnt/iproto/protocol.pyx":202
 * 
 *                 if self.fetch_schema:
 *                     self._do_fetch_schema(None)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._set_connection_ready()
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 202, __pyx_L1_error) }
      ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_do_fetch_schema(__pyx_cur_scope->__pyx_v_self, Py_None);

      /* "asynctnt/iproto/protocol.pyx":201
 *                              self.host, self.port)
 * 
 *                 if self.fetch_schema:             # <<<<<<<<<<<<<<
 *                     self._do_fetch_schema(None)
 *                 else:
 */
      goto __pyx_L5;
    }

    /* "asynctnt/iproto/protocol.pyx":204
 *                     self._do_fetch_schema(None)
 *                 else:
 *                     self._set_connection_ready()             # <<<<<<<<<<<<<<
 *             else:
 *                 logger.error('Tarantool[%s:%s] Authorization failed: %s',
 */
    /*else*/ {
      if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 204, __pyx_L1_error) }
      ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_ready(__pyx_cur_scope->__pyx_v_self);
    }
    __pyx_L5:;

    /* "asynctnt/iproto/protocol.pyx":197
 *                 return
 *             e = f.exception()
 *             if not e:             # <<<<<<<<<<<<<<
 *                 logger.debug('Tarantool[%s:%s] Authorized successfully',
 *                              self.host, self.port)
 */
    goto __pyx_L4;
  }

  /* "asynctnt/iproto/protocol.pyx":206
 *                     self._set_connection_ready()
 *             else:
 *                 logger.error('Tarantool[%s:%s] Authorization failed: %s',             # <<<<<<<<<<<<<<
 *                              self.host, self.port, str(e))
 *                 self._set_connection_error(e)
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asynctnt/iproto/protocol.pyx":207
 *             else:
 *                 logger.error('Tarantool[%s:%s] Authorization failed: %s',
 *                              self.host, self.port, str(e))             # <<<<<<<<<<<<<<
 *                 self._set_connection_error(e)
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 207, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 207, __pyx_L1_error) }
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_kp_u_Tarantool_s_s_Authorization_fail, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 206, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_kp_u_Tarantool_s_s_Authorization_fail, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 206, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_Tarantool_s_s_Authorization_fail);
      __Pyx_GIVEREF(__pyx_kp_u_Tarantool_s_s_Authorization_fail);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_kp_u_Tarantool_s_s_Authorization_fail);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, __pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_6, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":208
 *                 logger.error('Tarantool[%s:%s] Authorization failed: %s',
 *                              self.host, self.port, str(e))
 *                 self._set_connection_error(e)             # <<<<<<<<<<<<<<
 * 
 *         fut.add_done_callback(on_authorized)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 208, __pyx_L1_error) }
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_error(__pyx_cur_scope->__pyx_v_self, __pyx_v_e);
  }
  __pyx_L4:;

  /* "asynctnt/iproto/protocol.pyx":192
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 * 
 *         def on_authorized(f):             # <<<<<<<<<<<<<<
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._do_auth.on_authorized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":188
 *         waiter.set_result(req.response)
 * 
 *     cdef void _do_auth(self, str username, str password):             # <<<<<<<<<<<<<<
 *         # No extra error handling from Db.execute
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__do_auth(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *__pyx_cur_scope;
  PyObject *__pyx_v_fut = NULL;
  PyObject *__pyx_v_on_authorized = 0;
  __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("_do_auth", 0);
  __pyx_cur_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *)__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth(__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 188, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);

  /* "asynctnt/iproto/protocol.pyx":190
 *     cdef void _do_auth(self, str username, str password):
 *         # No extra error handling from Db.execute
 *         fut = self._db._auth(self.salt, username, password, 0, False)             # <<<<<<<<<<<<<<
 * 
 *         def on_authorized(f):
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->__pyx_base.salt;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db *)__pyx_cur_scope->__pyx_v_self->_db->__pyx_vtab)->_auth(__pyx_cur_scope->__pyx_v_self->_db, ((PyObject*)__pyx_t_1), __pyx_v_username, __pyx_v_password, 0.0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fut = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":192
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 * 
 *         def on_authorized(f):             # <<<<<<<<<<<<<<
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8asynctnt_6iproto_8protocol_12BaseProtocol_8_do_auth_1on_authorized, 0, __pyx_n_s_BaseProtocol__do_auth_locals_on, ((PyObject*)__pyx_cur_scope), __pyx_n_s_asynctnt_iproto_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_on_authorized = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":210
 *                 self._set_connection_error(e)
 * 
 *         fut.add_done_callback(on_authorized)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _do_fetch_schema(self, object fut):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_on_authorized) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_on_authorized);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":188
 *         waiter.set_result(req.response)
 * 
 *     cdef void _do_auth(self, str username, str password):             # <<<<<<<<<<<<<<
 *         # No extra error handling from Db.execute
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._do_auth", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fut);
  __Pyx_XDECREF(__pyx_v_on_authorized);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":218
 *         self._schema_fetch_in_progress = True
 * 
 *         def on_fetch(f):             # <<<<<<<<<<<<<<
 *             self._schema_fetch_in_progress = False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_1on_fetch(PyObject *__pyx_self, PyObject *__pyx_v_f); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_1on_fetch = {"on_fetch", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_1on_fetch, METH_O, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_1on_fetch(PyObject *__pyx_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_fetch (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_on_fetch(__pyx_self, ((PyObject *)__pyx_v_f));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_on_fetch(PyObject *__pyx_self, PyObject *__pyx_v_f) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *__pyx_cur_scope;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *__pyx_outer_scope;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_spaces = NULL;
  PyObject *__pyx_v_indexes = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int64_t __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_fetch", 0);
  __pyx_outer_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "asynctnt/iproto/protocol.pyx":219
 * 
 *         def on_fetch(f):
 *             self._schema_fetch_in_progress = False             # <<<<<<<<<<<<<<
 * 
 *             if f.cancelled():
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 219, __pyx_L1_error) }
  __pyx_cur_scope->__pyx_v_self->_schema_fetch_in_progress = 0;

  /* "asynctnt/iproto/protocol.pyx":221
 *             self._schema_fetch_in_progress = False
 * 
 *             if f.cancelled():             # <<<<<<<<<<<<<<
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_cancelled); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":222
 * 
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())             # <<<<<<<<<<<<<<
 *                 return
 *             e = f.exception()
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 222, __pyx_L1_error) }
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_futures); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 222, __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_CancelledError); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_error(__pyx_cur_scope->__pyx_v_self, __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":223
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return             # <<<<<<<<<<<<<<
 *             e = f.exception()
 *             if not e:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":221
 *             self._schema_fetch_in_progress = False
 * 
 *             if f.cancelled():             # <<<<<<<<<<<<<<
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return
 */
  }

  /* "asynctnt/iproto/protocol.pyx":224
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 *                 return
 *             e = f.exception()             # <<<<<<<<<<<<<<
 *             if not e:
 *                 spaces, indexes = f.result()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":225
 *                 return
 *             e = f.exception()
 *             if not e:             # <<<<<<<<<<<<<<
 *                 spaces, indexes = f.result()
 *                 logger.debug('Tarantool[%s:%s] Schema fetch succeeded. '
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_e); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 225, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "asynctnt/iproto/protocol.pyx":226
 *             e = f.exception()
 *             if not e:
 *                 spaces, indexes = f.result()             # <<<<<<<<<<<<<<
 *                 logger.debug('Tarantool[%s:%s] Schema fetch succeeded. '
 *                              'Version: %d, Spaces: %d, Indexes: %d.',
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(5, 226, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(5, 226, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(5, 226, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_v_spaces = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_indexes = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "asynctnt/iproto/protocol.pyx":227
 *             if not e:
 *                 spaces, indexes = f.result()
 *                 logger.debug('Tarantool[%s:%s] Schema fetch succeeded. '             # <<<<<<<<<<<<<<
 *                              'Version: %d, Spaces: %d, Indexes: %d.',
 *                              self.host, self.port,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asynctnt/iproto/protocol.pyx":229
 *                 logger.debug('Tarantool[%s:%s] Schema fetch succeeded. '
 *                              'Version: %d, Spaces: %d, Indexes: %d.',
 *                              self.host, self.port,             # <<<<<<<<<<<<<<
 *                              spaces.schema_id, len(spaces), len(indexes))
 *                 try:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 229, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 229, __pyx_L1_error) }

    /* "asynctnt/iproto/protocol.pyx":230
 *                              'Version: %d, Spaces: %d, Indexes: %d.',
 *                              self.host, self.port,
 *                              spaces.schema_id, len(spaces), len(indexes))             # <<<<<<<<<<<<<<
 *                 try:
 *                     self._schema = Schema.parse(spaces.schema_id,
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_spaces, __pyx_n_s_schema_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_Length(__pyx_v_spaces); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(5, 230, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_Length(__pyx_v_indexes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(5, 230, __pyx_L1_error)
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[7] = {__pyx_t_10, __pyx_kp_u_Tarantool_s_s_Schema_fetch_succe, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port, __pyx_t_3, __pyx_t_6, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[7] = {__pyx_t_10, __pyx_kp_u_Tarantool_s_s_Schema_fetch_succe, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port, __pyx_t_3, __pyx_t_6, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_Tarantool_s_s_Schema_fetch_succe);
      __Pyx_GIVEREF(__pyx_kp_u_Tarantool_s_s_Schema_fetch_succe);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_kp_u_Tarantool_s_s_Schema_fetch_succe);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_9);
      __pyx_t_3 = 0;
      __pyx_t_6 = 0;
      __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":231
 *                              self.host, self.port,
 *                              spaces.schema_id, len(spaces), len(indexes))
 *                 try:             # <<<<<<<<<<<<<<
 *                     self._schema = Schema.parse(spaces.schema_id,
 *                                                 spaces, indexes)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      /*try:*/ {

        /* "asynctnt/iproto/protocol.pyx":232
 *                              spaces.schema_id, len(spaces), len(indexes))
 *                 try:
 *                     self._schema = Schema.parse(spaces.schema_id,             # <<<<<<<<<<<<<<
 *                                                 spaces, indexes)
 *                 except Exception as e:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_spaces, __pyx_n_s_schema_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 232, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_16 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 232, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asynctnt/iproto/protocol.pyx":233
 *                 try:
 *                     self._schema = Schema.parse(spaces.schema_id,
 *                                                 spaces, indexes)             # <<<<<<<<<<<<<<
 *                 except Exception as e:
 *                     logger.exception(e)
 */
        __pyx_t_1 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse(__pyx_t_16, __pyx_v_spaces, __pyx_v_indexes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 232, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "asynctnt/iproto/protocol.pyx":232
 *                              spaces.schema_id, len(spaces), len(indexes))
 *                 try:
 *                     self._schema = Schema.parse(spaces.schema_id,             # <<<<<<<<<<<<<<
 *                                                 spaces, indexes)
 *                 except Exception as e:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 232, __pyx_L7_error) }
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->_schema);
        __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->_schema));
        __pyx_cur_scope->__pyx_v_self->_schema = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "asynctnt/iproto/protocol.pyx":231
 *                              self.host, self.port,
 *                              spaces.schema_id, len(spaces), len(indexes))
 *                 try:             # <<<<<<<<<<<<<<
 *                     self._schema = Schema.parse(spaces.schema_id,
 *                                                 spaces, indexes)
 */
      }
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L12_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "asynctnt/iproto/protocol.pyx":234
 *                     self._schema = Schema.parse(spaces.schema_id,
 *                                                 spaces, indexes)
 *                 except Exception as e:             # <<<<<<<<<<<<<<
 *                     logger.exception(e)
 *                     logger.error('Error happened while parsing schema. '
 */
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_11) {
        __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._do_fetch_schema.on_fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(5, 234, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_2);
        /*try:*/ {

          /* "asynctnt/iproto/protocol.pyx":235
 *                                                 spaces, indexes)
 *                 except Exception as e:
 *                     logger.exception(e)             # <<<<<<<<<<<<<<
 *                     logger.error('Error happened while parsing schema. '
 *                                  'Space, fields and index names currently '
 */
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 235, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 235, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_e);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 235, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "asynctnt/iproto/protocol.pyx":236
 *                 except Exception as e:
 *                     logger.exception(e)
 *                     logger.error('Error happened while parsing schema. '             # <<<<<<<<<<<<<<
 *                                  'Space, fields and index names currently '
 *                                  'not working. Please file an issue at '
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 236, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 236, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(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);
            }
          }
          __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_kp_u_Error_happened_while_parsing_sch) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_Error_happened_while_parsing_sch);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 236, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "asynctnt/iproto/protocol.pyx":240
 *                                  'not working. Please file an issue at '
 *                                  'https://github.com/igorcoding/asynctnt')
 *                     self.auto_refetch_schema = False             # <<<<<<<<<<<<<<
 *                     self.fetch_schema = False
 *                     self._schema_id = -1
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 240, __pyx_L18_error) }
          __pyx_cur_scope->__pyx_v_self->auto_refetch_schema = 0;

          /* "asynctnt/iproto/protocol.pyx":241
 *                                  'https://github.com/igorcoding/asynctnt')
 *                     self.auto_refetch_schema = False
 *                     self.fetch_schema = False             # <<<<<<<<<<<<<<
 *                     self._schema_id = -1
 *                     self._set_connection_ready()
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 241, __pyx_L18_error) }
          __pyx_cur_scope->__pyx_v_self->fetch_schema = 0;

          /* "asynctnt/iproto/protocol.pyx":242
 *                     self.auto_refetch_schema = False
 *                     self.fetch_schema = False
 *                     self._schema_id = -1             # <<<<<<<<<<<<<<
 *                     self._set_connection_ready()
 *                     if fut is not None:
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 242, __pyx_L18_error) }
          __pyx_cur_scope->__pyx_v_self->_schema_id = -1L;

          /* "asynctnt/iproto/protocol.pyx":243
 *                     self.fetch_schema = False
 *                     self._schema_id = -1
 *                     self._set_connection_ready()             # <<<<<<<<<<<<<<
 *                     if fut is not None:
 *                         fut.set_result(None)
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 243, __pyx_L18_error) }
          ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_ready(__pyx_cur_scope->__pyx_v_self);

          /* "asynctnt/iproto/protocol.pyx":244
 *                     self._schema_id = -1
 *                     self._set_connection_ready()
 *                     if fut is not None:             # <<<<<<<<<<<<<<
 *                         fut.set_result(None)
 *                     return
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_fut)) { __Pyx_RaiseClosureNameError("fut"); __PYX_ERR(5, 244, __pyx_L18_error) }
          __pyx_t_5 = (__pyx_cur_scope->__pyx_v_fut != Py_None);
          __pyx_t_4 = (__pyx_t_5 != 0);
          if (__pyx_t_4) {

            /* "asynctnt/iproto/protocol.pyx":245
 *                     self._set_connection_ready()
 *                     if fut is not None:
 *                         fut.set_result(None)             # <<<<<<<<<<<<<<
 *                     return
 * 
 */
            if (unlikely(!__pyx_cur_scope->__pyx_v_fut)) { __Pyx_RaiseClosureNameError("fut"); __PYX_ERR(5, 245, __pyx_L18_error) }
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fut, __pyx_n_s_set_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 245, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_3 = NULL;
            if (CYTHON_UNPACK_METHODS && 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);
              }
            }
            __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_6, Py_None);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 245, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asynctnt/iproto/protocol.pyx":244
 *                     self._schema_id = -1
 *                     self._set_connection_ready()
 *                     if fut is not None:             # <<<<<<<<<<<<<<
 *                         fut.set_result(None)
 *                     return
 */
          }

          /* "asynctnt/iproto/protocol.pyx":246
 *                     if fut is not None:
 *                         fut.set_result(None)
 *                     return             # <<<<<<<<<<<<<<
 * 
 *                 self._schema_id = self._schema.id
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L17_return;
        }

        /* "asynctnt/iproto/protocol.pyx":234
 *                     self._schema = Schema.parse(spaces.schema_id,
 *                                                 spaces, indexes)
 *                 except Exception as e:             # <<<<<<<<<<<<<<
 *                     logger.exception(e)
 *                     logger.error('Error happened while parsing schema. '
 */
        /*finally:*/ {
          __pyx_L18_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_11 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e);
              __pyx_v_e = NULL;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
            goto __pyx_L9_except_error;
          }
          __pyx_L17_return: {
            __pyx_t_24 = __pyx_r;
            __pyx_r = 0;
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
            __pyx_r = __pyx_t_24;
            __pyx_t_24 = 0;
            goto __pyx_L10_except_return;
          }
        }
      }
      goto __pyx_L9_except_error;
      __pyx_L9_except_error:;

      /* "asynctnt/iproto/protocol.pyx":231
 *                              self.host, self.port,
 *                              spaces.schema_id, len(spaces), len(indexes))
 *                 try:             # <<<<<<<<<<<<<<
 *                     self._schema = Schema.parse(spaces.schema_id,
 *                                                 spaces, indexes)
 */
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      goto __pyx_L1_error;
      __pyx_L10_except_return:;
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      goto __pyx_L0;
      __pyx_L12_try_end:;
    }

    /* "asynctnt/iproto/protocol.pyx":248
 *                     return
 * 
 *                 self._schema_id = self._schema.id             # <<<<<<<<<<<<<<
 *                 self._set_connection_ready()
 *                 if fut is not None:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 248, __pyx_L1_error) }
    __pyx_t_16 = __pyx_cur_scope->__pyx_v_self->_schema->id;
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 248, __pyx_L1_error) }
    __pyx_cur_scope->__pyx_v_self->_schema_id = __pyx_t_16;

    /* "asynctnt/iproto/protocol.pyx":249
 * 
 *                 self._schema_id = self._schema.id
 *                 self._set_connection_ready()             # <<<<<<<<<<<<<<
 *                 if fut is not None:
 *                     fut.set_result(self._schema)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 249, __pyx_L1_error) }
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_ready(__pyx_cur_scope->__pyx_v_self);

    /* "asynctnt/iproto/protocol.pyx":250
 *                 self._schema_id = self._schema.id
 *                 self._set_connection_ready()
 *                 if fut is not None:             # <<<<<<<<<<<<<<
 *                     fut.set_result(self._schema)
 *             else:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_fut)) { __Pyx_RaiseClosureNameError("fut"); __PYX_ERR(5, 250, __pyx_L1_error) }
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_fut != Py_None);
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "asynctnt/iproto/protocol.pyx":251
 *                 self._set_connection_ready()
 *                 if fut is not None:
 *                     fut.set_result(self._schema)             # <<<<<<<<<<<<<<
 *             else:
 *                 logger.error('Tarantool[%s:%s] Schema fetch failed: %s',
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_fut)) { __Pyx_RaiseClosureNameError("fut"); __PYX_ERR(5, 251, __pyx_L1_error) }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fut, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 251, __pyx_L1_error) }
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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);
        }
      }
      __pyx_t_12 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_cur_scope->__pyx_v_self->_schema)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->_schema));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "asynctnt/iproto/protocol.pyx":250
 *                 self._schema_id = self._schema.id
 *                 self._set_connection_ready()
 *                 if fut is not None:             # <<<<<<<<<<<<<<
 *                     fut.set_result(self._schema)
 *             else:
 */
    }

    /* "asynctnt/iproto/protocol.pyx":225
 *                 return
 *             e = f.exception()
 *             if not e:             # <<<<<<<<<<<<<<
 *                 spaces, indexes = f.result()
 *                 logger.debug('Tarantool[%s:%s] Schema fetch succeeded. '
 */
    goto __pyx_L4;
  }

  /* "asynctnt/iproto/protocol.pyx":253
 *                     fut.set_result(self._schema)
 *             else:
 *                 logger.error('Tarantool[%s:%s] Schema fetch failed: %s',             # <<<<<<<<<<<<<<
 *                              self.host, self.port, str(e))
 *                 if isinstance(e, asyncio.TimeoutError):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asynctnt/iproto/protocol.pyx":254
 *             else:
 *                 logger.error('Tarantool[%s:%s] Schema fetch failed: %s',
 *                              self.host, self.port, str(e))             # <<<<<<<<<<<<<<
 *                 if isinstance(e, asyncio.TimeoutError):
 *                     e = asyncio.TimeoutError('Schema fetch timeout')
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 254, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 254, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    __pyx_t_17 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_17 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_kp_u_Tarantool_s_s_Schema_fetch_faile, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port, __pyx_t_2};
      __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_17, 4+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_kp_u_Tarantool_s_s_Schema_fetch_faile, __pyx_cur_scope->__pyx_v_self->__pyx_base.host, __pyx_cur_scope->__pyx_v_self->__pyx_base.port, __pyx_t_2};
      __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_17, 4+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(4+__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_u_Tarantool_s_s_Schema_fetch_faile);
      __Pyx_GIVEREF(__pyx_kp_u_Tarantool_s_s_Schema_fetch_faile);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_17, __pyx_kp_u_Tarantool_s_s_Schema_fetch_faile);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_17, __pyx_cur_scope->__pyx_v_self->__pyx_base.host);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_17, __pyx_cur_scope->__pyx_v_self->__pyx_base.port);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_17, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "asynctnt/iproto/protocol.pyx":255
 *                 logger.error('Tarantool[%s:%s] Schema fetch failed: %s',
 *                              self.host, self.port, str(e))
 *                 if isinstance(e, asyncio.TimeoutError):             # <<<<<<<<<<<<<<
 *                     e = asyncio.TimeoutError('Schema fetch timeout')
 *                 self._set_connection_error(e)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 255, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "asynctnt/iproto/protocol.pyx":256
 *                              self.host, self.port, str(e))
 *                 if isinstance(e, asyncio.TimeoutError):
 *                     e = asyncio.TimeoutError('Schema fetch timeout')             # <<<<<<<<<<<<<<
 *                 self._set_connection_error(e)
 *                 if fut is not None:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_12, __pyx_kp_u_Schema_fetch_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_Schema_fetch_timeout);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asynctnt/iproto/protocol.pyx":255
 *                 logger.error('Tarantool[%s:%s] Schema fetch failed: %s',
 *                              self.host, self.port, str(e))
 *                 if isinstance(e, asyncio.TimeoutError):             # <<<<<<<<<<<<<<
 *                     e = asyncio.TimeoutError('Schema fetch timeout')
 *                 self._set_connection_error(e)
 */
    }

    /* "asynctnt/iproto/protocol.pyx":257
 *                 if isinstance(e, asyncio.TimeoutError):
 *                     e = asyncio.TimeoutError('Schema fetch timeout')
 *                 self._set_connection_error(e)             # <<<<<<<<<<<<<<
 *                 if fut is not None:
 *                     fut.set_exception(e)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(5, 257, __pyx_L1_error) }
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_set_connection_error(__pyx_cur_scope->__pyx_v_self, __pyx_v_e);

    /* "asynctnt/iproto/protocol.pyx":258
 *                     e = asyncio.TimeoutError('Schema fetch timeout')
 *                 self._set_connection_error(e)
 *                 if fut is not None:             # <<<<<<<<<<<<<<
 *                     fut.set_exception(e)
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_fut)) { __Pyx_RaiseClosureNameError("fut"); __PYX_ERR(5, 258, __pyx_L1_error) }
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_fut != Py_None);
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "asynctnt/iproto/protocol.pyx":259
 *                 self._set_connection_error(e)
 *                 if fut is not None:
 *                     fut.set_exception(e)             # <<<<<<<<<<<<<<
 * 
 *         self._schema_id = -1
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_fut)) { __Pyx_RaiseClosureNameError("fut"); __PYX_ERR(5, 259, __pyx_L1_error) }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fut, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_12, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_e);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asynctnt/iproto/protocol.pyx":258
 *                     e = asyncio.TimeoutError('Schema fetch timeout')
 *                 self._set_connection_error(e)
 *                 if fut is not None:             # <<<<<<<<<<<<<<
 *                     fut.set_exception(e)
 * 
 */
    }
  }
  __pyx_L4:;

  /* "asynctnt/iproto/protocol.pyx":218
 *         self._schema_fetch_in_progress = True
 * 
 *         def on_fetch(f):             # <<<<<<<<<<<<<<
 *             self._schema_fetch_in_progress = False
 * 
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._do_fetch_schema.on_fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_spaces);
  __Pyx_XDECREF(__pyx_v_indexes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":212
 *         fut.add_done_callback(on_authorized)
 * 
 *     cdef void _do_fetch_schema(self, object fut):             # <<<<<<<<<<<<<<
 *         if self._schema_fetch_in_progress:
 *             return
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__do_fetch_schema(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *__pyx_cur_scope;
  PyObject *__pyx_v_on_fetch = 0;
  PyObject *__pyx_v_fut_vspace = NULL;
  PyObject *__pyx_v_fut_vindex = NULL;
  PyObject *__pyx_v_gather_fut = 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("_do_fetch_schema", 0);
  __pyx_cur_scope = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *)__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema(__pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 212, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_fut = __pyx_v_fut;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fut);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fut);

  /* "asynctnt/iproto/protocol.pyx":213
 * 
 *     cdef void _do_fetch_schema(self, object fut):
 *         if self._schema_fetch_in_progress:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->_schema_fetch_in_progress != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/protocol.pyx":214
 *     cdef void _do_fetch_schema(self, object fut):
 *         if self._schema_fetch_in_progress:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._schema_fetch_in_progress = True
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":213
 * 
 *     cdef void _do_fetch_schema(self, object fut):
 *         if self._schema_fetch_in_progress:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":216
 *             return
 * 
 *         self._schema_fetch_in_progress = True             # <<<<<<<<<<<<<<
 * 
 *         def on_fetch(f):
 */
  __pyx_cur_scope->__pyx_v_self->_schema_fetch_in_progress = 1;

  /* "asynctnt/iproto/protocol.pyx":218
 *         self._schema_fetch_in_progress = True
 * 
 *         def on_fetch(f):             # <<<<<<<<<<<<<<
 *             self._schema_fetch_in_progress = False
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8asynctnt_6iproto_8protocol_12BaseProtocol_16_do_fetch_schema_1on_fetch, 0, __pyx_n_s_BaseProtocol__do_fetch_schema_lo, ((PyObject*)__pyx_cur_scope), __pyx_n_s_asynctnt_iproto_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_on_fetch = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":261
 *                     fut.set_exception(e)
 * 
 *         self._schema_id = -1             # <<<<<<<<<<<<<<
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)
 */
  __pyx_cur_scope->__pyx_v_self->_schema_id = -1L;

  /* "asynctnt/iproto/protocol.pyx":262
 * 
 *         self._schema_id = -1
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)             # <<<<<<<<<<<<<<
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_db), __pyx_n_s_select); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_timeout, __pyx_int_0) < 0) __PYX_ERR(5, 262, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__62, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_fut_vspace = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asynctnt/iproto/protocol.pyx":263
 *         self._schema_id = -1
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)             # <<<<<<<<<<<<<<
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,
 *                                     return_exceptions=False)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_db), __pyx_n_s_select); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_timeout, __pyx_int_0) < 0) __PYX_ERR(5, 263, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__63, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __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_v_fut_vindex = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":264
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,             # <<<<<<<<<<<<<<
 *                                     return_exceptions=False)
 *         gather_fut.add_done_callback(on_fetch)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_gather); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_fut_vspace);
  __Pyx_GIVEREF(__pyx_v_fut_vspace);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fut_vspace);
  __Pyx_INCREF(__pyx_v_fut_vindex);
  __Pyx_GIVEREF(__pyx_v_fut_vindex);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fut_vindex);

  /* "asynctnt/iproto/protocol.pyx":265
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,
 *                                     return_exceptions=False)             # <<<<<<<<<<<<<<
 *         gather_fut.add_done_callback(on_fetch)
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return_exceptions, Py_False) < 0) __PYX_ERR(5, 265, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":264
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,             # <<<<<<<<<<<<<<
 *                                     return_exceptions=False)
 *         gather_fut.add_done_callback(on_fetch)
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_gather_fut = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "asynctnt/iproto/protocol.pyx":266
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,
 *                                     return_exceptions=False)
 *         gather_fut.add_done_callback(on_fetch)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _on_connection_made(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gather_fut, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_on_fetch) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_on_fetch);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asynctnt/iproto/protocol.pyx":212
 *         fut.add_done_callback(on_authorized)
 * 
 *     cdef void _do_fetch_schema(self, object fut):             # <<<<<<<<<<<<<<
 *         if self._schema_fetch_in_progress:
 *             return
 */

  /* function exit code */
  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_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._do_fetch_schema", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_on_fetch);
  __Pyx_XDECREF(__pyx_v_fut_vspace);
  __Pyx_XDECREF(__pyx_v_fut_vindex);
  __Pyx_XDECREF(__pyx_v_gather_fut);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":268
 *         gather_fut.add_done_callback(on_fetch)
 * 
 *     cdef void _on_connection_made(self):             # <<<<<<<<<<<<<<
 *         CoreProtocol._on_connection_made(self)
 * 
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_connection_made(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("_on_connection_made", 0);

  /* "asynctnt/iproto/protocol.pyx":269
 * 
 *     cdef void _on_connection_made(self):
 *         CoreProtocol._on_connection_made(self)             # <<<<<<<<<<<<<<
 * 
 *         if self.on_connection_made_cb:
 */
  __pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_made(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self));

  /* "asynctnt/iproto/protocol.pyx":271
 *         CoreProtocol._on_connection_made(self)
 * 
 *         if self.on_connection_made_cb:             # <<<<<<<<<<<<<<
 *             self.on_connection_made_cb()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->on_connection_made_cb); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 271, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "asynctnt/iproto/protocol.pyx":272
 * 
 *         if self.on_connection_made_cb:
 *             self.on_connection_made_cb()             # <<<<<<<<<<<<<<
 * 
 *     cdef void _on_connection_lost(self, exc):
 */
    __Pyx_INCREF(__pyx_v_self->on_connection_made_cb);
    __pyx_t_3 = __pyx_v_self->on_connection_made_cb; __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 272, __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;

    /* "asynctnt/iproto/protocol.pyx":271
 *         CoreProtocol._on_connection_made(self)
 * 
 *         if self.on_connection_made_cb:             # <<<<<<<<<<<<<<
 *             self.on_connection_made_cb()
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":268
 *         gather_fut.add_done_callback(on_fetch)
 * 
 *     cdef void _on_connection_made(self):             # <<<<<<<<<<<<<<
 *         CoreProtocol._on_connection_made(self)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._on_connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":274
 *             self.on_connection_made_cb()
 * 
 *     cdef void _on_connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Request req
 */

static void __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_connection_lost(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req = 0;
  PyObject *__pyx_v_pkey;
  PyObject *__pyx_v_pvalue;
  Py_ssize_t __pyx_v_pos;
  CYTHON_UNUSED uint64_t __pyx_v_sync;
  PyObject *__pyx_v_waiter = NULL;
  PyObject *__pyx_v_err = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  uint64_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_connection_lost", 0);

  /* "asynctnt/iproto/protocol.pyx":282
 *             Py_ssize_t pos
 * 
 *         if self._closing:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closing); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asynctnt/iproto/protocol.pyx":283
 * 
 *         if self._closing:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._closing = True
 */
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":282
 *             Py_ssize_t pos
 * 
 *         if self._closing:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":285
 *             return
 * 
 *         self._closing = True             # <<<<<<<<<<<<<<
 * 
 *         pos = 0
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closing, Py_True) < 0) __PYX_ERR(5, 285, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":287
 *         self._closing = True
 * 
 *         pos = 0             # <<<<<<<<<<<<<<
 *         while cpython.dict.PyDict_Next(self._reqs, &pos, &pkey, &pvalue):
 *             sync = <uint64_t> <object> pkey
 */
  __pyx_v_pos = 0;

  /* "asynctnt/iproto/protocol.pyx":288
 * 
 *         pos = 0
 *         while cpython.dict.PyDict_Next(self._reqs, &pos, &pkey, &pvalue):             # <<<<<<<<<<<<<<
 *             sync = <uint64_t> <object> pkey
 *             req = <Request> pvalue
 */
  while (1) {
    __pyx_t_1 = __pyx_v_self->_reqs;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = (PyDict_Next(__pyx_t_1, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pvalue)) != 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_2) break;

    /* "asynctnt/iproto/protocol.pyx":289
 *         pos = 0
 *         while cpython.dict.PyDict_Next(self._reqs, &pos, &pkey, &pvalue):
 *             sync = <uint64_t> <object> pkey             # <<<<<<<<<<<<<<
 *             req = <Request> pvalue
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_As_uint64_t(((PyObject *)__pyx_v_pkey)); if (unlikely((__pyx_t_3 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 289, __pyx_L1_error)
    __pyx_v_sync = ((uint64_t)__pyx_t_3);

    /* "asynctnt/iproto/protocol.pyx":290
 *         while cpython.dict.PyDict_Next(self._reqs, &pos, &pkey, &pvalue):
 *             sync = <uint64_t> <object> pkey
 *             req = <Request> pvalue             # <<<<<<<<<<<<<<
 * 
 *             waiter = req.waiter
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_pvalue);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_req, ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":292
 *             req = <Request> pvalue
 * 
 *             waiter = req.waiter             # <<<<<<<<<<<<<<
 *             if waiter and not waiter.done():
 *                 err = None
 */
    __pyx_t_1 = __pyx_v_req->waiter;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_waiter, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":293
 * 
 *             waiter = req.waiter
 *             if waiter and not waiter.done():             # <<<<<<<<<<<<<<
 *                 err = None
 *                 if exc is None:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_waiter); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 293, __pyx_L1_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 293, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = ((!__pyx_t_4) != 0);
    __pyx_t_2 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "asynctnt/iproto/protocol.pyx":294
 *             waiter = req.waiter
 *             if waiter and not waiter.done():
 *                 err = None             # <<<<<<<<<<<<<<
 *                 if exc is None:
 *                     err = TarantoolNotConnectedError(
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_err, Py_None);

      /* "asynctnt/iproto/protocol.pyx":295
 *             if waiter and not waiter.done():
 *                 err = None
 *                 if exc is None:             # <<<<<<<<<<<<<<
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool'
 */
      __pyx_t_2 = (__pyx_v_exc == Py_None);
      __pyx_t_7 = (__pyx_t_2 != 0);
      if (__pyx_t_7) {

        /* "asynctnt/iproto/protocol.pyx":296
 *                 err = None
 *                 if exc is None:
 *                     err = TarantoolNotConnectedError(             # <<<<<<<<<<<<<<
 *                         'Lost connection to Tarantool'
 *                     )
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TarantoolNotConnectedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(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_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_Lost_connection_to_Tarantool) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_Lost_connection_to_Tarantool);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_err, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "asynctnt/iproto/protocol.pyx":295
 *             if waiter and not waiter.done():
 *                 err = None
 *                 if exc is None:             # <<<<<<<<<<<<<<
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool'
 */
        goto __pyx_L9;
      }

      /* "asynctnt/iproto/protocol.pyx":299
 *                         'Lost connection to Tarantool'
 *                     )
 *                 elif isinstance(exc, (ConnectionRefusedError,             # <<<<<<<<<<<<<<
 *                                       ConnectionResetError)):
 *                     err = TarantoolNotConnectedError(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ConnectionRefusedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "asynctnt/iproto/protocol.pyx":300
 *                     )
 *                 elif isinstance(exc, (ConnectionRefusedError,
 *                                       ConnectionResetError)):             # <<<<<<<<<<<<<<
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}: {}'.format(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ConnectionResetError); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "asynctnt/iproto/protocol.pyx":299
 *                         'Lost connection to Tarantool'
 *                     )
 *                 elif isinstance(exc, (ConnectionRefusedError,             # <<<<<<<<<<<<<<
 *                                       ConnectionResetError)):
 *                     err = TarantoolNotConnectedError(
 */
      __pyx_t_2 = PyObject_IsInstance(__pyx_v_exc, __pyx_t_1); 
      __pyx_t_4 = (__pyx_t_2 != 0);
      if (!__pyx_t_4) {
      } else {
        __pyx_t_7 = __pyx_t_4;
        goto __pyx_L10_bool_binop_done;
      }

      /* "asynctnt/iproto/protocol.pyx":300
 *                     )
 *                 elif isinstance(exc, (ConnectionRefusedError,
 *                                       ConnectionResetError)):             # <<<<<<<<<<<<<<
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}: {}'.format(
 */
      __pyx_t_4 = PyObject_IsInstance(__pyx_v_exc, __pyx_t_5); 
      __pyx_t_2 = (__pyx_t_4 != 0);
      __pyx_t_7 = __pyx_t_2;
      __pyx_L10_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asynctnt/iproto/protocol.pyx":299
 *                         'Lost connection to Tarantool'
 *                     )
 *                 elif isinstance(exc, (ConnectionRefusedError,             # <<<<<<<<<<<<<<
 *                                       ConnectionResetError)):
 *                     err = TarantoolNotConnectedError(
 */
      __pyx_t_2 = (__pyx_t_7 != 0);
      if (__pyx_t_2) {

        /* "asynctnt/iproto/protocol.pyx":301
 *                 elif isinstance(exc, (ConnectionRefusedError,
 *                                       ConnectionResetError)):
 *                     err = TarantoolNotConnectedError(             # <<<<<<<<<<<<<<
 *                         'Lost connection to Tarantool: {}: {}'.format(
 *                             exc.__class__.__name__, str(exc))
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TarantoolNotConnectedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "asynctnt/iproto/protocol.pyx":302
 *                                       ConnectionResetError)):
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}: {}'.format(             # <<<<<<<<<<<<<<
 *                             exc.__class__.__name__, str(exc))
 *                     )
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Lost_connection_to_Tarantool_2, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "asynctnt/iproto/protocol.pyx":303
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}: {}'.format(
 *                             exc.__class__.__name__, str(exc))             # <<<<<<<<<<<<<<
 *                     )
 *                 elif exc is ConnectionRefusedError \
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_exc, __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_exc); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_11 = NULL;
        __pyx_t_12 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_12 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 302, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 302, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_9);
          __pyx_t_10 = 0;
          __pyx_t_9 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_err, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "asynctnt/iproto/protocol.pyx":299
 *                         'Lost connection to Tarantool'
 *                     )
 *                 elif isinstance(exc, (ConnectionRefusedError,             # <<<<<<<<<<<<<<
 *                                       ConnectionResetError)):
 *                     err = TarantoolNotConnectedError(
 */
        goto __pyx_L9;
      }

      /* "asynctnt/iproto/protocol.pyx":305
 *                             exc.__class__.__name__, str(exc))
 *                     )
 *                 elif exc is ConnectionRefusedError \             # <<<<<<<<<<<<<<
 *                         or exc is ConnectionResetError:
 *                     err = TarantoolNotConnectedError(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ConnectionRefusedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = (__pyx_v_exc == __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = (__pyx_t_7 != 0);
      if (!__pyx_t_4) {
      } else {
        __pyx_t_2 = __pyx_t_4;
        goto __pyx_L12_bool_binop_done;
      }

      /* "asynctnt/iproto/protocol.pyx":306
 *                     )
 *                 elif exc is ConnectionRefusedError \
 *                         or exc is ConnectionResetError:             # <<<<<<<<<<<<<<
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}'.format(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ConnectionResetError); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = (__pyx_v_exc == __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = (__pyx_t_4 != 0);
      __pyx_t_2 = __pyx_t_7;
      __pyx_L12_bool_binop_done:;

      /* "asynctnt/iproto/protocol.pyx":305
 *                             exc.__class__.__name__, str(exc))
 *                     )
 *                 elif exc is ConnectionRefusedError \             # <<<<<<<<<<<<<<
 *                         or exc is ConnectionResetError:
 *                     err = TarantoolNotConnectedError(
 */
      if (__pyx_t_2) {

        /* "asynctnt/iproto/protocol.pyx":307
 *                 elif exc is ConnectionRefusedError \
 *                         or exc is ConnectionResetError:
 *                     err = TarantoolNotConnectedError(             # <<<<<<<<<<<<<<
 *                         'Lost connection to Tarantool: {}'.format(
 *                             exc.__name__)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TarantoolNotConnectedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "asynctnt/iproto/protocol.pyx":308
 *                         or exc is ConnectionResetError:
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}'.format(             # <<<<<<<<<<<<<<
 *                             exc.__name__)
 *                     )
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Lost_connection_to_Tarantool_3, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "asynctnt/iproto/protocol.pyx":309
 *                     err = TarantoolNotConnectedError(
 *                         'Lost connection to Tarantool: {}'.format(
 *                             exc.__name__)             # <<<<<<<<<<<<<<
 *                     )
 *                 else:
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_exc, __pyx_n_s_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_err, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "asynctnt/iproto/protocol.pyx":305
 *                             exc.__class__.__name__, str(exc))
 *                     )
 *                 elif exc is ConnectionRefusedError \             # <<<<<<<<<<<<<<
 *                         or exc is ConnectionResetError:
 *                     err = TarantoolNotConnectedError(
 */
        goto __pyx_L9;
      }

      /* "asynctnt/iproto/protocol.pyx":312
 *                     )
 *                 else:
 *                     err = exc             # <<<<<<<<<<<<<<
 * 
 *                 if err is not None:
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_v_err, __pyx_v_exc);
      }
      __pyx_L9:;

      /* "asynctnt/iproto/protocol.pyx":314
 *                     err = exc
 * 
 *                 if err is not None:             # <<<<<<<<<<<<<<
 *                     waiter.set_exception(err)
 *                     if req.response is not None:
 */
      __pyx_t_2 = (__pyx_v_err != Py_None);
      __pyx_t_7 = (__pyx_t_2 != 0);
      if (__pyx_t_7) {

        /* "asynctnt/iproto/protocol.pyx":315
 * 
 *                 if err is not None:
 *                     waiter.set_exception(err)             # <<<<<<<<<<<<<<
 *                     if req.response is not None:
 *                         req.response.set_exception(err)
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_err) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_err);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asynctnt/iproto/protocol.pyx":316
 *                 if err is not None:
 *                     waiter.set_exception(err)
 *                     if req.response is not None:             # <<<<<<<<<<<<<<
 *                         req.response.set_exception(err)
 * 
 */
        __pyx_t_7 = (((PyObject *)__pyx_v_req->response) != Py_None);
        __pyx_t_2 = (__pyx_t_7 != 0);
        if (__pyx_t_2) {

          /* "asynctnt/iproto/protocol.pyx":317
 *                     waiter.set_exception(err)
 *                     if req.response is not None:
 *                         req.response.set_exception(err)             # <<<<<<<<<<<<<<
 * 
 *         if self.on_connection_lost_cb:
 */
          __pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception(__pyx_v_req->response, __pyx_v_err);

          /* "asynctnt/iproto/protocol.pyx":316
 *                 if err is not None:
 *                     waiter.set_exception(err)
 *                     if req.response is not None:             # <<<<<<<<<<<<<<
 *                         req.response.set_exception(err)
 * 
 */
        }

        /* "asynctnt/iproto/protocol.pyx":314
 *                     err = exc
 * 
 *                 if err is not None:             # <<<<<<<<<<<<<<
 *                     waiter.set_exception(err)
 *                     if req.response is not None:
 */
      }

      /* "asynctnt/iproto/protocol.pyx":293
 * 
 *             waiter = req.waiter
 *             if waiter and not waiter.done():             # <<<<<<<<<<<<<<
 *                 err = None
 *                 if exc is None:
 */
    }
  }

  /* "asynctnt/iproto/protocol.pyx":319
 *                         req.response.set_exception(err)
 * 
 *         if self.on_connection_lost_cb:             # <<<<<<<<<<<<<<
 *             self.on_connection_lost_cb(exc)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->on_connection_lost_cb); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 319, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "asynctnt/iproto/protocol.pyx":320
 * 
 *         if self.on_connection_lost_cb:
 *             self.on_connection_lost_cb(exc)             # <<<<<<<<<<<<<<
 * 
 *         self._reqs = {}  # reset requests map
 */
    __Pyx_INCREF(__pyx_v_self->on_connection_lost_cb);
    __pyx_t_5 = __pyx_v_self->on_connection_lost_cb; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_exc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exc);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":319
 *                         req.response.set_exception(err)
 * 
 *         if self.on_connection_lost_cb:             # <<<<<<<<<<<<<<
 *             self.on_connection_lost_cb(exc)
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":322
 *             self.on_connection_lost_cb(exc)
 * 
 *         self._reqs = {}  # reset requests map             # <<<<<<<<<<<<<<
 * 
 *     cdef inline uint64_t next_sync(self):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_reqs);
  __Pyx_DECREF(__pyx_v_self->_reqs);
  __pyx_v_self->_reqs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":274
 *             self.on_connection_made_cb()
 * 
 *     cdef void _on_connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Request req
 */

  /* function exit code */
  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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_WriteUnraisable("asynctnt.iproto.protocol.BaseProtocol._on_connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
  __Pyx_XDECREF(__pyx_v_waiter);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
}

/* "asynctnt/iproto/protocol.pyx":324
 *         self._reqs = {}  # reset requests map
 * 
 *     cdef inline uint64_t next_sync(self):             # <<<<<<<<<<<<<<
 *         self._sync += 1
 *         return self._sync
 */

static CYTHON_INLINE uint64_t __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_next_sync(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_sync", 0);

  /* "asynctnt/iproto/protocol.pyx":325
 * 
 *     cdef inline uint64_t next_sync(self):
 *         self._sync += 1             # <<<<<<<<<<<<<<
 *         return self._sync
 * 
 */
  __pyx_v_self->_sync = (__pyx_v_self->_sync + 1);

  /* "asynctnt/iproto/protocol.pyx":326
 *     cdef inline uint64_t next_sync(self):
 *         self._sync += 1
 *         return self._sync             # <<<<<<<<<<<<<<
 * 
 *     def _on_request_timeout(self, waiter):
 */
  __pyx_r = __pyx_v_self->_sync;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":324
 *         self._reqs = {}  # reset requests map
 * 
 *     cdef inline uint64_t next_sync(self):             # <<<<<<<<<<<<<<
 *         self._sync += 1
 *         return self._sync
 */

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

/* "asynctnt/iproto/protocol.pyx":328
 *         return self._sync
 * 
 *     def _on_request_timeout(self, waiter):             # <<<<<<<<<<<<<<
 *         cdef Request req
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_5_on_request_timeout(PyObject *__pyx_v_self, PyObject *__pyx_v_waiter); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_5_on_request_timeout(PyObject *__pyx_v_self, PyObject *__pyx_v_waiter) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_request_timeout (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_4_on_request_timeout(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_waiter));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_4_on_request_timeout(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  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("_on_request_timeout", 0);

  /* "asynctnt/iproto/protocol.pyx":331
 *         cdef Request req
 * 
 *         if waiter.done():             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":332
 * 
 *         if waiter.done():
 *             return             # <<<<<<<<<<<<<<
 * 
 *         req = waiter._req
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":331
 *         cdef Request req
 * 
 *         if waiter.done():             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":334
 *             return
 * 
 *         req = waiter._req             # <<<<<<<<<<<<<<
 *         req.timeout_handle.cancel()
 *         req.timeout_handle = None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_req); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Request))))) __PYX_ERR(5, 334, __pyx_L1_error)
  __pyx_v_req = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":335
 * 
 *         req = waiter._req
 *         req.timeout_handle.cancel()             # <<<<<<<<<<<<<<
 *         req.timeout_handle = None
 *         waiter.set_exception(
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_req->timeout_handle, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 335, __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;

  /* "asynctnt/iproto/protocol.pyx":336
 *         req = waiter._req
 *         req.timeout_handle.cancel()
 *         req.timeout_handle = None             # <<<<<<<<<<<<<<
 *         waiter.set_exception(
 *             asyncio.TimeoutError(
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_req->timeout_handle);
  __Pyx_DECREF(__pyx_v_req->timeout_handle);
  __pyx_v_req->timeout_handle = Py_None;

  /* "asynctnt/iproto/protocol.pyx":337
 *         req.timeout_handle.cancel()
 *         req.timeout_handle = None
 *         waiter.set_exception(             # <<<<<<<<<<<<<<
 *             asyncio.TimeoutError(
 *                 '{} exceeded timeout'.format(req.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asynctnt/iproto/protocol.pyx":338
 *         req.timeout_handle = None
 *         waiter.set_exception(
 *             asyncio.TimeoutError(             # <<<<<<<<<<<<<<
 *                 '{} exceeded timeout'.format(req.__class__.__name__))
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asynctnt/iproto/protocol.pyx":339
 *         waiter.set_exception(
 *             asyncio.TimeoutError(
 *                 '{} exceeded timeout'.format(req.__class__.__name__))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_exceeded_timeout, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_req), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 337, __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;

  /* "asynctnt/iproto/protocol.pyx":328
 *         return self._sync
 * 
 *     def _on_request_timeout(self, waiter):             # <<<<<<<<<<<<<<
 *         cdef Request req
 * 
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._on_request_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":342
 *         )
 * 
 *     def _on_request_completed(self, fut):             # <<<<<<<<<<<<<<
 *         cdef Request req = fut._req
 *         fut._req = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_7_on_request_completed(PyObject *__pyx_v_self, PyObject *__pyx_v_fut); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_7_on_request_completed(PyObject *__pyx_v_self, PyObject *__pyx_v_fut) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_request_completed (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_6_on_request_completed(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_fut));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_6_on_request_completed(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  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("_on_request_completed", 0);

  /* "asynctnt/iproto/protocol.pyx":343
 * 
 *     def _on_request_completed(self, fut):
 *         cdef Request req = fut._req             # <<<<<<<<<<<<<<
 *         fut._req = None
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_req); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Request))))) __PYX_ERR(5, 343, __pyx_L1_error)
  __pyx_v_req = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":344
 *     def _on_request_completed(self, fut):
 *         cdef Request req = fut._req
 *         fut._req = None             # <<<<<<<<<<<<<<
 * 
 *         if req.timeout_handle is not None:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_fut, __pyx_n_s_req, Py_None) < 0) __PYX_ERR(5, 344, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":346
 *         fut._req = None
 * 
 *         if req.timeout_handle is not None:             # <<<<<<<<<<<<<<
 *             req.timeout_handle.cancel()
 *             req.timeout_handle = None
 */
  __pyx_t_2 = (__pyx_v_req->timeout_handle != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "asynctnt/iproto/protocol.pyx":347
 * 
 *         if req.timeout_handle is not None:
 *             req.timeout_handle.cancel()             # <<<<<<<<<<<<<<
 *             req.timeout_handle = None
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_req->timeout_handle, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":348
 *         if req.timeout_handle is not None:
 *             req.timeout_handle.cancel()
 *             req.timeout_handle = None             # <<<<<<<<<<<<<<
 * 
 *     cdef object _new_waiter_for_request(self, Request req, float timeout):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_req->timeout_handle);
    __Pyx_DECREF(__pyx_v_req->timeout_handle);
    __pyx_v_req->timeout_handle = Py_None;

    /* "asynctnt/iproto/protocol.pyx":346
 *         fut._req = None
 * 
 *         if req.timeout_handle is not None:             # <<<<<<<<<<<<<<
 *             req.timeout_handle.cancel()
 *             req.timeout_handle = None
 */
  }

  /* "asynctnt/iproto/protocol.pyx":342
 *         )
 * 
 *     def _on_request_completed(self, fut):             # <<<<<<<<<<<<<<
 *         cdef Request req = fut._req
 *         fut._req = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._on_request_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":350
 *             req.timeout_handle = None
 * 
 *     cdef object _new_waiter_for_request(self, Request req, float timeout):             # <<<<<<<<<<<<<<
 *         fut = self.create_future()
 *         fut._req = req  # to be able to retrieve request after done()
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__new_waiter_for_request(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req, float __pyx_v_timeout) {
  PyObject *__pyx_v_fut = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  float __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  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("_new_waiter_for_request", 0);

  /* "asynctnt/iproto/protocol.pyx":351
 * 
 *     cdef object _new_waiter_for_request(self, Request req, float timeout):
 *         fut = self.create_future()             # <<<<<<<<<<<<<<
 *         fut._req = req  # to be able to retrieve request after done()
 *         req.waiter = fut
 */
  __Pyx_INCREF(__pyx_v_self->create_future);
  __pyx_t_2 = __pyx_v_self->create_future; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fut = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":352
 *     cdef object _new_waiter_for_request(self, Request req, float timeout):
 *         fut = self.create_future()
 *         fut._req = req  # to be able to retrieve request after done()             # <<<<<<<<<<<<<<
 *         req.waiter = fut
 *         req.response = Response.__new__(Response, self.encoding,
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_fut, __pyx_n_s_req, ((PyObject *)__pyx_v_req)) < 0) __PYX_ERR(5, 352, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":353
 *         fut = self.create_future()
 *         fut._req = req  # to be able to retrieve request after done()
 *         req.waiter = fut             # <<<<<<<<<<<<<<
 *         req.response = Response.__new__(Response, self.encoding,
 *                                         req.push_subscribe)
 */
  __Pyx_INCREF(__pyx_v_fut);
  __Pyx_GIVEREF(__pyx_v_fut);
  __Pyx_GOTREF(__pyx_v_req->waiter);
  __Pyx_DECREF(__pyx_v_req->waiter);
  __pyx_v_req->waiter = __pyx_v_fut;

  /* "asynctnt/iproto/protocol.pyx":355
 *         req.waiter = fut
 *         req.response = Response.__new__(Response, self.encoding,
 *                                         req.push_subscribe)             # <<<<<<<<<<<<<<
 * 
 *         if timeout < 0:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_req->push_subscribe); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "asynctnt/iproto/protocol.pyx":354
 *         fut._req = req  # to be able to retrieve request after done()
 *         req.waiter = fut
 *         req.response = Response.__new__(Response, self.encoding,             # <<<<<<<<<<<<<<
 *                                         req.push_subscribe)
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->__pyx_base.encoding);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8asynctnt_6iproto_8protocol_Response(((PyTypeObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_Response), __pyx_t_2, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_req->response);
  __Pyx_DECREF(((PyObject *)__pyx_v_req->response));
  __pyx_v_req->response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":357
 *                                         req.push_subscribe)
 * 
 *         if timeout < 0:             # <<<<<<<<<<<<<<
 *             timeout = self.request_timeout
 *         if timeout is not None and timeout > 0:
 */
  __pyx_t_4 = ((__pyx_v_timeout < 0.0) != 0);
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":358
 * 
 *         if timeout < 0:
 *             timeout = self.request_timeout             # <<<<<<<<<<<<<<
 *         if timeout is not None and timeout > 0:
 *             req.timeout_handle = \
 */
    __pyx_t_5 = __pyx_v_self->request_timeout;
    __pyx_v_timeout = __pyx_t_5;

    /* "asynctnt/iproto/protocol.pyx":357
 *                                         req.push_subscribe)
 * 
 *         if timeout < 0:             # <<<<<<<<<<<<<<
 *             timeout = self.request_timeout
 *         if timeout is not None and timeout > 0:
 */
  }

  /* "asynctnt/iproto/protocol.pyx":359
 *         if timeout < 0:
 *             timeout = self.request_timeout
 *         if timeout is not None and timeout > 0:             # <<<<<<<<<<<<<<
 *             req.timeout_handle = \
 *                 self.loop.call_later(timeout,
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_4 = __pyx_t_7;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_7 = ((__pyx_v_timeout > 0.0) != 0);
  __pyx_t_4 = __pyx_t_7;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "asynctnt/iproto/protocol.pyx":361
 *         if timeout is not None and timeout > 0:
 *             req.timeout_handle = \
 *                 self.loop.call_later(timeout,             # <<<<<<<<<<<<<<
 *                                      self._on_request_timeout_cb, fut)
 *             fut.add_done_callback(self._on_request_completed_cb)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_call_later); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asynctnt/iproto/protocol.pyx":362
 *             req.timeout_handle = \
 *                 self.loop.call_later(timeout,
 *                                      self._on_request_timeout_cb, fut)             # <<<<<<<<<<<<<<
 *             fut.add_done_callback(self._on_request_completed_cb)
 *         return fut
 */
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(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_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_3, __pyx_v_self->_on_request_timeout_cb, __pyx_v_fut};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 361, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_3, __pyx_v_self->_on_request_timeout_cb, __pyx_v_fut};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 361, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 361, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __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+__pyx_t_9, __pyx_t_3);
      __Pyx_INCREF(__pyx_v_self->_on_request_timeout_cb);
      __Pyx_GIVEREF(__pyx_v_self->_on_request_timeout_cb);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_self->_on_request_timeout_cb);
      __Pyx_INCREF(__pyx_v_fut);
      __Pyx_GIVEREF(__pyx_v_fut);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_fut);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 361, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asynctnt/iproto/protocol.pyx":360
 *             timeout = self.request_timeout
 *         if timeout is not None and timeout > 0:
 *             req.timeout_handle = \             # <<<<<<<<<<<<<<
 *                 self.loop.call_later(timeout,
 *                                      self._on_request_timeout_cb, fut)
 */
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_req->timeout_handle);
    __Pyx_DECREF(__pyx_v_req->timeout_handle);
    __pyx_v_req->timeout_handle = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "asynctnt/iproto/protocol.pyx":363
 *                 self.loop.call_later(timeout,
 *                                      self._on_request_timeout_cb, fut)
 *             fut.add_done_callback(self._on_request_completed_cb)             # <<<<<<<<<<<<<<
 *         return fut
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_v_self->_on_request_completed_cb) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->_on_request_completed_cb);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 363, __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;

    /* "asynctnt/iproto/protocol.pyx":359
 *         if timeout < 0:
 *             timeout = self.request_timeout
 *         if timeout is not None and timeout > 0:             # <<<<<<<<<<<<<<
 *             req.timeout_handle = \
 *                 self.loop.call_later(timeout,
 */
  }

  /* "asynctnt/iproto/protocol.pyx":364
 *                                      self._on_request_timeout_cb, fut)
 *             fut.add_done_callback(self._on_request_completed_cb)
 *         return fut             # <<<<<<<<<<<<<<
 * 
 *     cdef Db _create_db(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fut);
  __pyx_r = __pyx_v_fut;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":350
 *             req.timeout_handle = None
 * 
 *     cdef object _new_waiter_for_request(self, Request req, float timeout):             # <<<<<<<<<<<<<<
 *         fut = self.create_future()
 *         fut._req = req  # to be able to retrieve request after done()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._new_waiter_for_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fut);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":366
 *         return fut
 * 
 *     cdef Db _create_db(self):             # <<<<<<<<<<<<<<
 *         return Db.new(self)
 * 
 */

static struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__create_db(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_db", 0);

  /* "asynctnt/iproto/protocol.pyx":367
 * 
 *     cdef Db _create_db(self):
 *         return Db.new(self)             # <<<<<<<<<<<<<<
 * 
 *     def create_db(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_8asynctnt_6iproto_8protocol_2Db_new(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":366
 *         return fut
 * 
 *     cdef Db _create_db(self):             # <<<<<<<<<<<<<<
 *         return Db.new(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._create_db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":369
 *         return Db.new(self)
 * 
 *     def create_db(self):             # <<<<<<<<<<<<<<
 *         return self._create_db()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_9create_db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_9create_db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_db (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_8create_db(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/protocol.pyx":370
 * 
 *     def create_db(self):
 *         return self._create_db()             # <<<<<<<<<<<<<<
 * 
 *     def get_common_db(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_create_db(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":369
 *         return Db.new(self)
 * 
 *     def create_db(self):             # <<<<<<<<<<<<<<
 *         return self._create_db()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.create_db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":372
 *         return self._create_db()
 * 
 *     def get_common_db(self):             # <<<<<<<<<<<<<<
 *         return self._db
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_11get_common_db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_11get_common_db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_common_db (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_10get_common_db(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_10get_common_db(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_common_db", 0);

  /* "asynctnt/iproto/protocol.pyx":373
 * 
 *     def get_common_db(self):
 *         return self._db             # <<<<<<<<<<<<<<
 * 
 *     cdef object execute(self, Request req, WriteBuffer buf, float timeout):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_db));
  __pyx_r = ((PyObject *)__pyx_v_self->_db);
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":372
 *         return self._create_db()
 * 
 *     def get_common_db(self):             # <<<<<<<<<<<<<<
 *         return self._db
 * 
 */

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

/* "asynctnt/iproto/protocol.pyx":375
 *         return self._db
 * 
 *     cdef object execute(self, Request req, WriteBuffer buf, float timeout):             # <<<<<<<<<<<<<<
 *         if self.con_state == CONNECTION_BAD:
 *             raise TarantoolNotConnectedError('Tarantool is not connected')
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_execute(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_req, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_v_buf, float __pyx_v_timeout) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("execute", 0);

  /* "asynctnt/iproto/protocol.pyx":376
 * 
 *     cdef object execute(self, Request req, WriteBuffer buf, float timeout):
 *         if self.con_state == CONNECTION_BAD:             # <<<<<<<<<<<<<<
 *             raise TarantoolNotConnectedError('Tarantool is not connected')
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.con_state == __pyx_e_8asynctnt_6iproto_8protocol_CONNECTION_BAD) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asynctnt/iproto/protocol.pyx":377
 *     cdef object execute(self, Request req, WriteBuffer buf, float timeout):
 *         if self.con_state == CONNECTION_BAD:
 *             raise TarantoolNotConnectedError('Tarantool is not connected')             # <<<<<<<<<<<<<<
 * 
 *         cpython.dict.PyDict_SetItem(self._reqs, req.sync, req)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TarantoolNotConnectedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(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);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_Tarantool_is_not_connected) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Tarantool_is_not_connected);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(5, 377, __pyx_L1_error)

    /* "asynctnt/iproto/protocol.pyx":376
 * 
 *     cdef object execute(self, Request req, WriteBuffer buf, float timeout):
 *         if self.con_state == CONNECTION_BAD:             # <<<<<<<<<<<<<<
 *             raise TarantoolNotConnectedError('Tarantool is not connected')
 * 
 */
  }

  /* "asynctnt/iproto/protocol.pyx":379
 *             raise TarantoolNotConnectedError('Tarantool is not connected')
 * 
 *         cpython.dict.PyDict_SetItem(self._reqs, req.sync, req)             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
 */
  __pyx_t_2 = __pyx_v_self->_reqs;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_req->sync); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyDict_SetItem(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_req)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asynctnt/iproto/protocol.pyx":380
 * 
 *         cpython.dict.PyDict_SetItem(self._reqs, req.sync, req)
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *         return self._new_waiter_for_request(req, timeout)
 */
  ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_buf)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 380, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":382
 *         self._write(buf)
 * 
 *         return self._new_waiter_for_request(req, timeout)             # <<<<<<<<<<<<<<
 * 
 *     cdef uint32_t transform_iterator(self, iterator) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter_for_request(__pyx_v_self, __pyx_v_req, __pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":375
 *         return self._db
 * 
 *     cdef object execute(self, Request req, WriteBuffer buf, float timeout):             # <<<<<<<<<<<<<<
 *         if self.con_state == CONNECTION_BAD:
 *             raise TarantoolNotConnectedError('Tarantool is not connected')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":384
 *         return self._new_waiter_for_request(req, timeout)
 * 
 *     cdef uint32_t transform_iterator(self, iterator) except *:             # <<<<<<<<<<<<<<
 *         if isinstance(iterator, int):
 *             return iterator
 */

static uint32_t __pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_transform_iterator(CYTHON_UNUSED struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_iterator) {
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  uint32_t __pyx_t_3;
  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("transform_iterator", 0);

  /* "asynctnt/iproto/protocol.pyx":385
 * 
 *     cdef uint32_t transform_iterator(self, iterator) except *:
 *         if isinstance(iterator, int):             # <<<<<<<<<<<<<<
 *             return iterator
 *         if isinstance(iterator, Iterator):
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_iterator); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/protocol.pyx":386
 *     cdef uint32_t transform_iterator(self, iterator) except *:
 *         if isinstance(iterator, int):
 *             return iterator             # <<<<<<<<<<<<<<
 *         if isinstance(iterator, Iterator):
 *             return iterator.value
 */
    __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_iterator); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 386, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":385
 * 
 *     cdef uint32_t transform_iterator(self, iterator) except *:
 *         if isinstance(iterator, int):             # <<<<<<<<<<<<<<
 *             return iterator
 *         if isinstance(iterator, Iterator):
 */
  }

  /* "asynctnt/iproto/protocol.pyx":387
 *         if isinstance(iterator, int):
 *             return iterator
 *         if isinstance(iterator, Iterator):             # <<<<<<<<<<<<<<
 *             return iterator.value
 *         if isinstance(iterator, str):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Iterator); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_iterator, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/protocol.pyx":388
 *             return iterator
 *         if isinstance(iterator, Iterator):
 *             return iterator.value             # <<<<<<<<<<<<<<
 *         if isinstance(iterator, str):
 *             return Iterator[iterator]
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_iterator, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 388, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":387
 *         if isinstance(iterator, int):
 *             return iterator
 *         if isinstance(iterator, Iterator):             # <<<<<<<<<<<<<<
 *             return iterator.value
 *         if isinstance(iterator, str):
 */
  }

  /* "asynctnt/iproto/protocol.pyx":389
 *         if isinstance(iterator, Iterator):
 *             return iterator.value
 *         if isinstance(iterator, str):             # <<<<<<<<<<<<<<
 *             return Iterator[iterator]
 *         else:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_iterator); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "asynctnt/iproto/protocol.pyx":390
 *             return iterator.value
 *         if isinstance(iterator, str):
 *             return Iterator[iterator]             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Iterator is of unsupported type '
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Iterator); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_iterator); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_5); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 390, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "asynctnt/iproto/protocol.pyx":389
 *         if isinstance(iterator, Iterator):
 *             return iterator.value
 *         if isinstance(iterator, str):             # <<<<<<<<<<<<<<
 *             return Iterator[iterator]
 *         else:
 */
  }

  /* "asynctnt/iproto/protocol.pyx":392
 *             return Iterator[iterator]
 *         else:
 *             raise TypeError('Iterator is of unsupported type '             # <<<<<<<<<<<<<<
 *                             '(asynctnt.Iterator, int, str)')
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(5, 392, __pyx_L1_error)
  }

  /* "asynctnt/iproto/protocol.pyx":384
 *         return self._new_waiter_for_request(req, timeout)
 * 
 *     cdef uint32_t transform_iterator(self, iterator) except *:             # <<<<<<<<<<<<<<
 *         if isinstance(iterator, int):
 *             return iterator
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.transform_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":395
 *                             '(asynctnt.Iterator, int, str)')
 * 
 *     cdef object _refetch_schema(self):             # <<<<<<<<<<<<<<
 *         if self._refetch_schema_future is None \
 *                 or self._refetch_schema_future.done():
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__refetch_schema(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  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("_refetch_schema", 0);

  /* "asynctnt/iproto/protocol.pyx":396
 * 
 *     cdef object _refetch_schema(self):
 *         if self._refetch_schema_future is None \             # <<<<<<<<<<<<<<
 *                 or self._refetch_schema_future.done():
 *             self._refetch_schema_future = self.create_future()
 */
  __pyx_t_2 = (__pyx_v_self->_refetch_schema_future == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asynctnt/iproto/protocol.pyx":397
 *     cdef object _refetch_schema(self):
 *         if self._refetch_schema_future is None \
 *                 or self._refetch_schema_future.done():             # <<<<<<<<<<<<<<
 *             self._refetch_schema_future = self.create_future()
 *             self._do_fetch_schema(self._refetch_schema_future)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_refetch_schema_future, __pyx_n_s_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "asynctnt/iproto/protocol.pyx":396
 * 
 *     cdef object _refetch_schema(self):
 *         if self._refetch_schema_future is None \             # <<<<<<<<<<<<<<
 *                 or self._refetch_schema_future.done():
 *             self._refetch_schema_future = self.create_future()
 */
  if (__pyx_t_1) {

    /* "asynctnt/iproto/protocol.pyx":398
 *         if self._refetch_schema_future is None \
 *                 or self._refetch_schema_future.done():
 *             self._refetch_schema_future = self.create_future()             # <<<<<<<<<<<<<<
 *             self._do_fetch_schema(self._refetch_schema_future)
 * 
 */
    __Pyx_INCREF(__pyx_v_self->create_future);
    __pyx_t_5 = __pyx_v_self->create_future; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->_refetch_schema_future);
    __Pyx_DECREF(__pyx_v_self->_refetch_schema_future);
    __pyx_v_self->_refetch_schema_future = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "asynctnt/iproto/protocol.pyx":399
 *                 or self._refetch_schema_future.done():
 *             self._refetch_schema_future = self.create_future()
 *             self._do_fetch_schema(self._refetch_schema_future)             # <<<<<<<<<<<<<<
 * 
 *         return self._refetch_schema_future
 */
    __pyx_t_4 = __pyx_v_self->_refetch_schema_future;
    __Pyx_INCREF(__pyx_t_4);
    ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_do_fetch_schema(__pyx_v_self, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asynctnt/iproto/protocol.pyx":396
 * 
 *     cdef object _refetch_schema(self):
 *         if self._refetch_schema_future is None \             # <<<<<<<<<<<<<<
 *                 or self._refetch_schema_future.done():
 *             self._refetch_schema_future = self.create_future()
 */
  }

  /* "asynctnt/iproto/protocol.pyx":401
 *             self._do_fetch_schema(self._refetch_schema_future)
 * 
 *         return self._refetch_schema_future             # <<<<<<<<<<<<<<
 * 
 *     def refetch_schema(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_refetch_schema_future);
  __pyx_r = __pyx_v_self->_refetch_schema_future;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":395
 *                             '(asynctnt.Iterator, int, str)')
 * 
 *     cdef object _refetch_schema(self):             # <<<<<<<<<<<<<<
 *         if self._refetch_schema_future is None \
 *                 or self._refetch_schema_future.done():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol._refetch_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/protocol.pyx":403
 *         return self._refetch_schema_future
 * 
 *     def refetch_schema(self):             # <<<<<<<<<<<<<<
 *         return self._refetch_schema()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_13refetch_schema(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_13refetch_schema(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("refetch_schema (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_12refetch_schema(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asynctnt/iproto/protocol.pyx":404
 * 
 *     def refetch_schema(self):
 *         return self._refetch_schema()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_refetch_schema(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asynctnt/iproto/protocol.pyx":403
 *         return self._refetch_schema_future
 * 
 *     def refetch_schema(self):             # <<<<<<<<<<<<<<
 *         return self._refetch_schema()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.refetch_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_14__reduce_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_14__reduce_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._db, self._on_request_completed_cb, self._on_request_timeout_cb, self._refetch_schema_future, self._reqs, self._schema, self._schema_fetch_in_progress, self._schema_id, self._sync, self.auto_refetch_schema, self.con_state, self.connected_fut, self.create_future, self.encoding, self.fetch_schema, self.host, self.loop, self.on_connection_lost_cb, self.on_connection_made_cb, self.password, self.port, self.rbuf, self.request_timeout, self.salt, self.state, self.username, self.version)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_schema_fetch_in_progress); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_schema_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->_sync); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->auto_refetch_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(__pyx_v_self->__pyx_base.con_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->fetch_schema); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->request_timeout); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(27); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_db));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_db));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_self->_db));
  __Pyx_INCREF(__pyx_v_self->_on_request_completed_cb);
  __Pyx_GIVEREF(__pyx_v_self->_on_request_completed_cb);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_self->_on_request_completed_cb);
  __Pyx_INCREF(__pyx_v_self->_on_request_timeout_cb);
  __Pyx_GIVEREF(__pyx_v_self->_on_request_timeout_cb);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_self->_on_request_timeout_cb);
  __Pyx_INCREF(__pyx_v_self->_refetch_schema_future);
  __Pyx_GIVEREF(__pyx_v_self->_refetch_schema_future);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_v_self->_refetch_schema_future);
  __Pyx_INCREF(__pyx_v_self->_reqs);
  __Pyx_GIVEREF(__pyx_v_self->_reqs);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_self->_reqs);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_schema));
  PyTuple_SET_ITEM(__pyx_t_9, 5, ((PyObject *)__pyx_v_self->_schema));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 9, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 10, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->connected_fut);
  __Pyx_GIVEREF(__pyx_v_self->connected_fut);
  PyTuple_SET_ITEM(__pyx_t_9, 11, __pyx_v_self->connected_fut);
  __Pyx_INCREF(__pyx_v_self->create_future);
  __Pyx_GIVEREF(__pyx_v_self->create_future);
  PyTuple_SET_ITEM(__pyx_t_9, 12, __pyx_v_self->create_future);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
  PyTuple_SET_ITEM(__pyx_t_9, 13, __pyx_v_self->__pyx_base.encoding);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 14, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.host);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.host);
  PyTuple_SET_ITEM(__pyx_t_9, 15, __pyx_v_self->__pyx_base.host);
  __Pyx_INCREF(__pyx_v_self->loop);
  __Pyx_GIVEREF(__pyx_v_self->loop);
  PyTuple_SET_ITEM(__pyx_t_9, 16, __pyx_v_self->loop);
  __Pyx_INCREF(__pyx_v_self->on_connection_lost_cb);
  __Pyx_GIVEREF(__pyx_v_self->on_connection_lost_cb);
  PyTuple_SET_ITEM(__pyx_t_9, 17, __pyx_v_self->on_connection_lost_cb);
  __Pyx_INCREF(__pyx_v_self->on_connection_made_cb);
  __Pyx_GIVEREF(__pyx_v_self->on_connection_made_cb);
  PyTuple_SET_ITEM(__pyx_t_9, 18, __pyx_v_self->on_connection_made_cb);
  __Pyx_INCREF(__pyx_v_self->password);
  __Pyx_GIVEREF(__pyx_v_self->password);
  PyTuple_SET_ITEM(__pyx_t_9, 19, __pyx_v_self->password);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.port);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.port);
  PyTuple_SET_ITEM(__pyx_t_9, 20, __pyx_v_self->__pyx_base.port);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.rbuf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.rbuf));
  PyTuple_SET_ITEM(__pyx_t_9, 21, ((PyObject *)__pyx_v_self->__pyx_base.rbuf));
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_9, 22, __pyx_t_7);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.salt);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.salt);
  PyTuple_SET_ITEM(__pyx_t_9, 23, __pyx_v_self->__pyx_base.salt);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 24, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_self->username);
  __Pyx_GIVEREF(__pyx_v_self->username);
  PyTuple_SET_ITEM(__pyx_t_9, 25, __pyx_v_self->username);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.version);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.version);
  PyTuple_SET_ITEM(__pyx_t_9, 26, __pyx_v_self->__pyx_base.version);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._db, self._on_request_completed_cb, self._on_request_timeout_cb, self._refetch_schema_future, self._reqs, self._schema, self._schema_fetch_in_progress, self._schema_id, self._sync, self.auto_refetch_schema, self.con_state, self.connected_fut, self.create_future, self.encoding, self.fetch_schema, self.host, self.loop, self.on_connection_lost_cb, self.on_connection_made_cb, self.password, self.port, self.rbuf, self.request_timeout, self.salt, self.state, self.username, self.version)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v__dict = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "(tree fragment)":7
 *     state = (self._db, self._on_request_completed_cb, self._on_request_timeout_cb, self._refetch_schema_future, self._reqs, self._schema, self._schema_fetch_in_progress, self._schema_id, self._sync, self.auto_refetch_schema, self.con_state, self.connected_fut, self.create_future, self.encoding, self.fetch_schema, self.host, self.loop, self.on_connection_lost_cb, self.on_connection_made_cb, self.password, self.port, self.rbuf, self.request_timeout, self.salt, self.state, self.username, self.version)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_10 = (__pyx_v__dict != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict);
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._db is not None or self._on_request_completed_cb is not None or self._on_request_timeout_cb is not None or self._refetch_schema_future is not None or self._reqs is not None or self._schema is not None or self.connected_fut is not None or self.create_future is not None or self.encoding is not None or self.host is not None or self.loop is not None or self.on_connection_lost_cb is not None or self.on_connection_made_cb is not None or self.password is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.username is not None or self.version is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._db, self._on_request_completed_cb, self._on_request_timeout_cb, self._refetch_schema_future, self._reqs, self._schema, self._schema_fetch_in_progress, self._schema_id, self._sync, self.auto_refetch_schema, self.con_state, self.connected_fut, self.create_future, self.encoding, self.fetch_schema, self.host, self.loop, self.on_connection_lost_cb, self.on_connection_made_cb, self.password, self.port, self.rbuf, self.request_timeout, self.salt, self.state, self.username, self.version)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._db is not None or self._on_request_completed_cb is not None or self._on_request_timeout_cb is not None or self._refetch_schema_future is not None or self._reqs is not None or self._schema is not None or self.connected_fut is not None or self.create_future is not None or self.encoding is not None or self.host is not None or self.loop is not None or self.on_connection_lost_cb is not None or self.on_connection_made_cb is not None or self.password is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.username is not None or self.version is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, None), state
 */
  /*else*/ {
    __pyx_t_10 = (((PyObject *)__pyx_v_self->_db) != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->_on_request_completed_cb != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->_on_request_timeout_cb != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->_refetch_schema_future != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->_reqs != ((PyObject*)Py_None));
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->_schema) != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->connected_fut != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->create_future != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->__pyx_base.encoding != ((PyObject*)Py_None));
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->__pyx_base.host != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->loop != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->on_connection_lost_cb != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->on_connection_made_cb != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->password != ((PyObject*)Py_None));
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->__pyx_base.port != Py_None);
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->__pyx_base.rbuf) != Py_None);
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->__pyx_base.salt != ((PyObject*)Py_None));
    __pyx_t_12 = (__pyx_t_10 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->username != ((PyObject*)Py_None));
    __pyx_t_10 = (__pyx_t_12 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_11 = __pyx_t_10;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_self->__pyx_base.version != ((PyObject*)Py_None));
    __pyx_t_12 = (__pyx_t_10 != 0);
    __pyx_t_11 = __pyx_t_12;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_11;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._db is not None or self._on_request_completed_cb is not None or self._on_request_timeout_cb is not None or self._refetch_schema_future is not None or self._reqs is not None or self._schema is not None or self.connected_fut is not None or self.create_future is not None or self.encoding is not None or self.host is not None or self.loop is not None or self.on_connection_lost_cb is not None or self.on_connection_made_cb is not None or self.password is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.username is not None or self.version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, None), state
 *     else:
 */
  __pyx_t_11 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_11) {

    /* "(tree fragment)":13
 *         use_setstate = self._db is not None or self._on_request_completed_cb is not None or self._on_request_timeout_cb is not None or self._refetch_schema_future is not None or self._reqs is not None or self._schema is not None or self.connected_fut is not None or self.create_future is not None or self.encoding is not None or self.host is not None or self.loop is not None or self.on_connection_lost_cb is not None or self.on_connection_made_cb is not None or self.password is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.username is not None or self.version is not None
 *     if use_setstate:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_29796805);
    __Pyx_GIVEREF(__pyx_int_29796805);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_29796805);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._db is not None or self._on_request_completed_cb is not None or self._on_request_timeout_cb is not None or self._refetch_schema_future is not None or self._reqs is not None or self._schema is not None or self.connected_fut is not None or self.create_future is not None or self.encoding is not None or self.host is not None or self.loop is not None or self.on_connection_lost_cb is not None or self.on_connection_made_cb is not None or self.password is not None or self.port is not None or self.rbuf is not None or self.salt is not None or self.username is not None or self.version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, None), state
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_29796805);
    __Pyx_GIVEREF(__pyx_int_29796805);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_29796805);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
    __pyx_t_7 = 0;
    __pyx_t_9 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_16__setstate_cython__(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_12BaseProtocol_16__setstate_cython__(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_BaseProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x1c6a9c5, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.BaseProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Request(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_1__pyx_unpickle_Request(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_1__pyx_unpickle_Request = {"__pyx_unpickle_Request", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_1__pyx_unpickle_Request, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_1__pyx_unpickle_Request(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Request (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Request", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Request", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Request") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Request", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_Request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol___pyx_unpickle_Request(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol___pyx_unpickle_Request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Request", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x01f354f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x01f354f) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x01f354f:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)
 *     __pyx_result = Request.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x01f354f:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Request.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x01, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x01f354f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)
 *     __pyx_result = Request.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_Request), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)
 *     __pyx_result = Request.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Request.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_Request__set_state(((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x01f354f = (op, parse_as_tuples, parse_metadata, push_subscribe, response, schema_id, space, sync, timeout_handle, waiter))" % __pyx_checksum)
 *     __pyx_result = Request.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Request(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* 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("asynctnt.iproto.protocol.__pyx_unpickle_Request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_Request__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  uint64_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Request__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[10])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)__Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->op = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->parse_as_tuples = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->parse_metadata = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->push_subscribe = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Response))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->response);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->response));
  __pyx_v___pyx_result->response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->schema_id = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->space);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->space));
  __pyx_v___pyx_result->space = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->sync = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->timeout_handle);
  __Pyx_DECREF(__pyx_v___pyx_result->timeout_handle);
  __pyx_v___pyx_result->timeout_handle = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->waiter);
  __Pyx_DECREF(__pyx_v___pyx_result->waiter);
  __pyx_v___pyx_result->waiter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[10])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_6 > 10) != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_3 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[10])             # <<<<<<<<<<<<<<
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[10])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_11);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_Request__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_PushIterator(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_3__pyx_unpickle_PushIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_3__pyx_unpickle_PushIterator = {"__pyx_unpickle_PushIterator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_3__pyx_unpickle_PushIterator, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_3__pyx_unpickle_PushIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_PushIterator (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PushIterator", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PushIterator", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_PushIterator") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_PushIterator", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_PushIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_2__pyx_unpickle_PushIterator(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_2__pyx_unpickle_PushIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_PushIterator", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd6d3964:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd6d3964) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd6d3964:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)
 *     __pyx_result = PushIterator.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xd6d3964:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = PushIterator.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd6d3964:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)
 *     __pyx_result = PushIterator.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_PushIterator), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)
 *     __pyx_result = PushIterator.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = PushIterator.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_PushIterator__set_state(((struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd6d3964 = (_fut, _request, _response))" % __pyx_checksum)
 *     __pyx_result = PushIterator.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_PushIterator(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* 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("asynctnt.iproto.protocol.__pyx_unpickle_PushIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_PushIterator__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  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("__pyx_unpickle_PushIterator__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_fut);
  __Pyx_DECREF(__pyx_v___pyx_result->_fut);
  __pyx_v___pyx_result->_fut = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Request))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_request);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_request));
  __pyx_v___pyx_result->_request = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Response))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_response);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_response));
  __pyx_v___pyx_result->_response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 3) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_PushIterator__set_state(<PushIterator> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_PushIterator__set_state(PushIterator __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._fut = __pyx_state[0]; __pyx_result._request = __pyx_state[1]; __pyx_result._response = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_PushIterator__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_5__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_5__pyx_unpickle_CoreProtocol = {"__pyx_unpickle_CoreProtocol", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_5__pyx_unpickle_CoreProtocol, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_5__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CoreProtocol") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_4__pyx_unpickle_CoreProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_4__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf188771:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf188771) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf188771:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xf188771:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf188771:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_CoreProtocol), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_CoreProtocol__set_state(((struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf188771 = (con_state, encoding, host, port, rbuf, salt, state, version))" % __pyx_checksum)
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* 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("asynctnt.iproto.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState __pyx_t_2;
  enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  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("__pyx_unpickle_CoreProtocol__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[8])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)__Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->con_state = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->encoding);
  __Pyx_DECREF(__pyx_v___pyx_result->encoding);
  __pyx_v___pyx_result->encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->host);
  __Pyx_DECREF(__pyx_v___pyx_result->host);
  __pyx_v___pyx_result->host = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->port);
  __Pyx_DECREF(__pyx_v___pyx_result->port);
  __pyx_v___pyx_result->port = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_ReadBuffer))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->rbuf);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->rbuf));
  __pyx_v___pyx_result->rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->salt);
  __Pyx_DECREF(__pyx_v___pyx_result->salt);
  __pyx_v___pyx_result->salt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)__Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->state = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->version);
  __Pyx_DECREF(__pyx_v___pyx_result->version);
  __pyx_v___pyx_result->version = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[8])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_6 = ((__pyx_t_5 > 8) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[8])             # <<<<<<<<<<<<<<
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[8])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_CoreProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8asynctnt_6iproto_8protocol_7__pyx_unpickle_BaseProtocol = {"__pyx_unpickle_BaseProtocol", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_7__pyx_unpickle_BaseProtocol, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8asynctnt_6iproto_8protocol_7__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BaseProtocol") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8asynctnt_6iproto_8protocol_6__pyx_unpickle_BaseProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_8asynctnt_6iproto_8protocol_6__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x1c6a9c5:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x1c6a9c5) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x1c6a9c5:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x1c6a9c5:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x1c, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x1c6a9c5:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_BaseProtocol), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_BaseProtocol__set_state(((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x1c6a9c5 = (_db, _on_request_completed_cb, _on_request_timeout_cb, _refetch_schema_future, _reqs, _schema, _schema_fetch_in_progress, _schema_id, _sync, auto_refetch_schema, con_state, connected_fut, create_future, encoding, fetch_schema, host, loop, on_connection_lost_cb, on_connection_made_cb, password, port, rbuf, request_timeout, salt, state, username, version))" % __pyx_checksum)
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* 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("asynctnt.iproto.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8asynctnt_6iproto_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int64_t __pyx_t_3;
  uint64_t __pyx_t_4;
  enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState __pyx_t_5;
  float __pyx_t_6;
  enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[27])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Db))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_db);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_db));
  __pyx_v___pyx_result->_db = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_on_request_completed_cb);
  __Pyx_DECREF(__pyx_v___pyx_result->_on_request_completed_cb);
  __pyx_v___pyx_result->_on_request_completed_cb = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_on_request_timeout_cb);
  __Pyx_DECREF(__pyx_v___pyx_result->_on_request_timeout_cb);
  __pyx_v___pyx_result->_on_request_timeout_cb = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_refetch_schema_future);
  __Pyx_DECREF(__pyx_v___pyx_result->_refetch_schema_future);
  __pyx_v___pyx_result->_refetch_schema_future = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_reqs);
  __Pyx_DECREF(__pyx_v___pyx_result->_reqs);
  __pyx_v___pyx_result->_reqs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_Schema))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_schema);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->_schema));
  __pyx_v___pyx_result->_schema = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_schema_fetch_in_progress = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_schema_id = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_sync = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->auto_refetch_schema = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = ((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)__Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.con_state = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->connected_fut);
  __Pyx_DECREF(__pyx_v___pyx_result->connected_fut);
  __pyx_v___pyx_result->connected_fut = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->create_future);
  __Pyx_DECREF(__pyx_v___pyx_result->create_future);
  __pyx_v___pyx_result->create_future = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding);
  __pyx_v___pyx_result->__pyx_base.encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->fetch_schema = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.host);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.host);
  __pyx_v___pyx_result->__pyx_base.host = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->loop);
  __Pyx_DECREF(__pyx_v___pyx_result->loop);
  __pyx_v___pyx_result->loop = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->on_connection_lost_cb);
  __Pyx_DECREF(__pyx_v___pyx_result->on_connection_lost_cb);
  __pyx_v___pyx_result->on_connection_lost_cb = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->on_connection_made_cb);
  __Pyx_DECREF(__pyx_v___pyx_result->on_connection_made_cb);
  __pyx_v___pyx_result->on_connection_made_cb = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->password);
  __Pyx_DECREF(__pyx_v___pyx_result->password);
  __pyx_v___pyx_result->password = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.port);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.port);
  __pyx_v___pyx_result->__pyx_base.port = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8asynctnt_6iproto_8protocol_ReadBuffer))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.rbuf);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.rbuf));
  __pyx_v___pyx_result->__pyx_base.rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->request_timeout = __pyx_t_6;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.salt);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.salt);
  __pyx_v___pyx_result->__pyx_base.salt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = ((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)__Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.state = __pyx_t_7;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __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_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->username);
  __Pyx_DECREF(__pyx_v___pyx_result->username);
  __pyx_v___pyx_result->username = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.version);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.version);
  __pyx_v___pyx_result->__pyx_base.version = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[27])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_t_8 > 27) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_2 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 != 0);
  __pyx_t_2 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[27])             # <<<<<<<<<<<<<<
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[27])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._db = __pyx_state[0]; __pyx_result._on_request_completed_cb = __pyx_state[1]; __pyx_result._on_request_timeout_cb = __pyx_state[2]; __pyx_result._refetch_schema_future = __pyx_state[3]; __pyx_result._reqs = __pyx_state[4]; __pyx_result._schema = __pyx_state[5]; __pyx_result._schema_fetch_in_progress = __pyx_state[6]; __pyx_result._schema_id = __pyx_state[7]; __pyx_result._sync = __pyx_state[8]; __pyx_result.auto_refetch_schema = __pyx_state[9]; __pyx_result.con_state = __pyx_state[10]; __pyx_result.connected_fut = __pyx_state[11]; __pyx_result.create_future = __pyx_state[12]; __pyx_result.encoding = __pyx_state[13]; __pyx_result.fetch_schema = __pyx_state[14]; __pyx_result.host = __pyx_state[15]; __pyx_result.loop = __pyx_state[16]; __pyx_result.on_connection_lost_cb = __pyx_state[17]; __pyx_result.on_connection_made_cb = __pyx_state[18]; __pyx_result.password = __pyx_state[19]; __pyx_result.port = __pyx_state[20]; __pyx_result.rbuf = __pyx_state[21]; __pyx_result.request_timeout = __pyx_state[22]; __pyx_result.salt = __pyx_state[23]; __pyx_result.state = __pyx_state[24]; __pyx_result.username = __pyx_state[25]; __pyx_result.version = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("asynctnt.iproto.protocol.__pyx_unpickle_BaseProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asynctnt/iproto/rbuffer.pxd":4
 * 
 * 
 * cdef inline size_t size_t_max(size_t a, size_t b):             # <<<<<<<<<<<<<<
 *     if a > b:
 *         return a
 */

static CYTHON_INLINE size_t __pyx_f_8asynctnt_6iproto_8protocol_size_t_max(size_t __pyx_v_a, size_t __pyx_v_b) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("size_t_max", 0);

  /* "asynctnt/iproto/rbuffer.pxd":5
 * 
 * cdef inline size_t size_t_max(size_t a, size_t b):
 *     if a > b:             # <<<<<<<<<<<<<<
 *         return a
 *     return b
 */
  __pyx_t_1 = ((__pyx_v_a > __pyx_v_b) != 0);
  if (__pyx_t_1) {

    /* "asynctnt/iproto/rbuffer.pxd":6
 * cdef inline size_t size_t_max(size_t a, size_t b):
 *     if a > b:
 *         return a             # <<<<<<<<<<<<<<
 *     return b
 * 
 */
    __pyx_r = __pyx_v_a;
    goto __pyx_L0;

    /* "asynctnt/iproto/rbuffer.pxd":5
 * 
 * cdef inline size_t size_t_max(size_t a, size_t b):
 *     if a > b:             # <<<<<<<<<<<<<<
 *         return a
 *     return b
 */
  }

  /* "asynctnt/iproto/rbuffer.pxd":7
 *     if a > b:
 *         return a
 *     return b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_b;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pxd":4
 * 
 * 
 * cdef inline size_t size_t_max(size_t a, size_t b):             # <<<<<<<<<<<<<<
 *     if a > b:
 *         return a
 */

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

/* "asynctnt/iproto/rbuffer.pxd":10
 * 
 * 
 * cdef inline uint32_t nearest_power_of_2(uint32_t v):             # <<<<<<<<<<<<<<
 *     v -= 1
 *     v |= v >> 1
 */

static CYTHON_INLINE uint32_t __pyx_f_8asynctnt_6iproto_8protocol_nearest_power_of_2(uint32_t __pyx_v_v) {
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nearest_power_of_2", 0);

  /* "asynctnt/iproto/rbuffer.pxd":11
 * 
 * cdef inline uint32_t nearest_power_of_2(uint32_t v):
 *     v -= 1             # <<<<<<<<<<<<<<
 *     v |= v >> 1
 *     v |= v >> 2
 */
  __pyx_v_v = (__pyx_v_v - 1);

  /* "asynctnt/iproto/rbuffer.pxd":12
 * cdef inline uint32_t nearest_power_of_2(uint32_t v):
 *     v -= 1
 *     v |= v >> 1             # <<<<<<<<<<<<<<
 *     v |= v >> 2
 *     v |= v >> 4
 */
  __pyx_v_v = (__pyx_v_v | (__pyx_v_v >> 1));

  /* "asynctnt/iproto/rbuffer.pxd":13
 *     v -= 1
 *     v |= v >> 1
 *     v |= v >> 2             # <<<<<<<<<<<<<<
 *     v |= v >> 4
 *     v |= v >> 8
 */
  __pyx_v_v = (__pyx_v_v | (__pyx_v_v >> 2));

  /* "asynctnt/iproto/rbuffer.pxd":14
 *     v |= v >> 1
 *     v |= v >> 2
 *     v |= v >> 4             # <<<<<<<<<<<<<<
 *     v |= v >> 8
 *     v |= v >> 16
 */
  __pyx_v_v = (__pyx_v_v | (__pyx_v_v >> 4));

  /* "asynctnt/iproto/rbuffer.pxd":15
 *     v |= v >> 2
 *     v |= v >> 4
 *     v |= v >> 8             # <<<<<<<<<<<<<<
 *     v |= v >> 16
 *     v += 1
 */
  __pyx_v_v = (__pyx_v_v | (__pyx_v_v >> 8));

  /* "asynctnt/iproto/rbuffer.pxd":16
 *     v |= v >> 4
 *     v |= v >> 8
 *     v |= v >> 16             # <<<<<<<<<<<<<<
 *     v += 1
 *     return v
 */
  __pyx_v_v = (__pyx_v_v | (__pyx_v_v >> 16));

  /* "asynctnt/iproto/rbuffer.pxd":17
 *     v |= v >> 8
 *     v |= v >> 16
 *     v += 1             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
  __pyx_v_v = (__pyx_v_v + 1);

  /* "asynctnt/iproto/rbuffer.pxd":18
 *     v |= v >> 16
 *     v += 1
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "asynctnt/iproto/rbuffer.pxd":10
 * 
 * 
 * cdef inline uint32_t nearest_power_of_2(uint32_t v):             # <<<<<<<<<<<<<<
 *     v -= 1
 *     v |= v >> 1
 */

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

/* "asynctnt/iproto/request.pxd":22
 *                             SchemaSpace space, bint push_subscribe)
 * 
 *     cdef inline TntFields fields(self):             # <<<<<<<<<<<<<<
 *         if self.space is None:
 *             return None
 */

static CYTHON_INLINE struct C_TntFields *__pyx_f_8asynctnt_6iproto_8protocol_7Request_fields(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_v_self) {
  struct C_TntFields *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("fields", 0);

  /* "asynctnt/iproto/request.pxd":23
 * 
 *     cdef inline TntFields fields(self):
 *         if self.space is None:             # <<<<<<<<<<<<<<
 *             return None
 *         return self.space.fields
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->space) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "asynctnt/iproto/request.pxd":24
 *     cdef inline TntFields fields(self):
 *         if self.space is None:
 *             return None             # <<<<<<<<<<<<<<
 *         return self.space.fields
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct C_TntFields *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asynctnt/iproto/request.pxd":23
 * 
 *     cdef inline TntFields fields(self):
 *         if self.space is None:             # <<<<<<<<<<<<<<
 *             return None
 *         return self.space.fields
 */
  }

  /* "asynctnt/iproto/request.pxd":25
 *         if self.space is None:
 *             return None
 *         return self.space.fields             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->space->fields));
  __pyx_r = __pyx_v_self->space->fields;
  goto __pyx_L0;

  /* "asynctnt/iproto/request.pxd":22
 *                             SchemaSpace space, bint push_subscribe)
 * 
 *     cdef inline TntFields fields(self):             # <<<<<<<<<<<<<<
 *         if self.space is None:
 *             return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_TntFields __pyx_vtable_8asynctnt_6iproto_8protocol_TntFields;

static struct C_TntFields *__pyx_freelist_8asynctnt_6iproto_8protocol_TntFields[128];
static int __pyx_freecount_8asynctnt_6iproto_8protocol_TntFields = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct C_TntFields *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol_TntFields > 0) & (t->tp_basicsize == sizeof(struct C_TntFields)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol_TntFields[--__pyx_freecount_8asynctnt_6iproto_8protocol_TntFields];
    memset(o, 0, sizeof(struct C_TntFields));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct C_TntFields *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_TntFields;
  p->_names = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_mapping = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_TntFields(PyObject *o) {
  struct C_TntFields *p = (struct C_TntFields *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_names);
  Py_CLEAR(p->_mapping);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol_TntFields < 128) & (Py_TYPE(o)->tp_basicsize == sizeof(struct C_TntFields)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol_TntFields[__pyx_freecount_8asynctnt_6iproto_8protocol_TntFields++] = ((struct C_TntFields *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_TntFields(PyObject *o, visitproc v, void *a) {
  int e;
  struct C_TntFields *p = (struct C_TntFields *)o;
  if (p->_names) {
    e = (*v)(p->_names, a); if (e) return e;
  }
  if (p->_mapping) {
    e = (*v)(p->_mapping, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_TntFields(PyObject *o) {
  PyObject* tmp;
  struct C_TntFields *p = (struct C_TntFields *)o;
  tmp = ((PyObject*)p->_names);
  p->_names = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_mapping);
  p->_mapping = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_TntFields[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_5__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_7__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) C_TntFields_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.TntFields", /*tp_name*/
  sizeof(struct C_TntFields), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_TntFields, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  __pyx_pw_8asynctnt_6iproto_8protocol_9TntFields_3__repr__, /*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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol_TntFields, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_TntFields, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_TntFields, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_TntFields, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaIndex(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *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_8asynctnt_6iproto_8protocol_SchemaIndex *)o);
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->index_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->unique = Py_None; Py_INCREF(Py_None);
  p->fields = ((struct C_TntFields *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_SchemaIndex(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  Py_CLEAR(p->index_type);
  Py_CLEAR(p->unique);
  Py_CLEAR(p->fields);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_SchemaIndex(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)o;
  if (p->unique) {
    e = (*v)(p->unique, a); if (e) return e;
  }
  if (p->fields) {
    e = (*v)(((PyObject *)p->fields), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_SchemaIndex(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *)o;
  tmp = ((PyObject*)p->unique);
  p->unique = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fields);
  p->fields = ((struct C_TntFields *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_SchemaIndex[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_5__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_7__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.SchemaIndex", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_SchemaIndex, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_3__repr__, /*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_8asynctnt_6iproto_8protocol_SchemaIndex, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_SchemaIndex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_SchemaIndex, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaIndex, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummyIndex(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaIndex(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_SchemaDummyIndex[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_1__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummyIndex_3__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.SchemaDummyIndex", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummyIndex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_SchemaIndex, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaIndex_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  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_8asynctnt_6iproto_8protocol_SchemaIndex, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_SchemaIndex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_SchemaDummyIndex, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummyIndex, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace __pyx_vtable_8asynctnt_6iproto_8protocol_SchemaSpace;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaSpace(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *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_8asynctnt_6iproto_8protocol_SchemaSpace *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaSpace;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->engine = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->flags = Py_None; Py_INCREF(Py_None);
  p->fields = ((struct C_TntFields *)Py_None); Py_INCREF(Py_None);
  p->indexes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_SchemaSpace(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  Py_CLEAR(p->engine);
  Py_CLEAR(p->flags);
  Py_CLEAR(p->fields);
  Py_CLEAR(p->indexes);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_SchemaSpace(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)o;
  if (p->flags) {
    e = (*v)(p->flags, a); if (e) return e;
  }
  if (p->fields) {
    e = (*v)(((PyObject *)p->fields), a); if (e) return e;
  }
  if (p->indexes) {
    e = (*v)(p->indexes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_SchemaSpace(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)o;
  tmp = ((PyObject*)p->flags);
  p->flags = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fields);
  p->fields = ((struct C_TntFields *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->indexes);
  p->indexes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_SchemaSpace[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_5__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_7__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.SchemaSpace", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_SchemaSpace, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_3__repr__, /*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_8asynctnt_6iproto_8protocol_SchemaSpace, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_SchemaSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_SchemaSpace, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaSpace, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaDummySpace __pyx_vtable_8asynctnt_6iproto_8protocol_SchemaDummySpace;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummySpace(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *p;
  PyObject *o = __pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaSpace(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_SchemaSpace*)__pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaDummySpace;
  return o;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_SchemaDummySpace[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummySpace_1__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_16SchemaDummySpace_3__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.SchemaDummySpace", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaDummySpace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_SchemaSpace, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_8asynctnt_6iproto_8protocol_11SchemaSpace_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  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_8asynctnt_6iproto_8protocol_SchemaSpace, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_SchemaSpace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_SchemaDummySpace, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_SchemaDummySpace, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Schema __pyx_vtable_8asynctnt_6iproto_8protocol_Schema;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Schema(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *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_8asynctnt_6iproto_8protocol_Schema *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_Schema;
  p->schema = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Schema(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->schema);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_Schema(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)o;
  if (p->schema) {
    e = (*v)(p->schema, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_Schema(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)o;
  tmp = ((PyObject*)p->schema);
  p->schema = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_Schema[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_5__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_6Schema_7__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_Schema = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.Schema", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Schema, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  __pyx_pw_8asynctnt_6iproto_8protocol_6Schema_3__repr__, /*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_8asynctnt_6iproto_8protocol_Schema, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_Schema, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_Schema, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_Schema, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_WriteBuffer __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer;

static struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *__pyx_freelist_8asynctnt_6iproto_8protocol_WriteBuffer[256];
static int __pyx_freecount_8asynctnt_6iproto_8protocol_WriteBuffer = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_WriteBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol_WriteBuffer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol_WriteBuffer[--__pyx_freecount_8asynctnt_6iproto_8protocol_WriteBuffer];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_WriteBuffer;
  p->_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_WriteBuffer(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_encoding);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol_WriteBuffer < 256) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol_WriteBuffer[__pyx_freecount_8asynctnt_6iproto_8protocol_WriteBuffer++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_WriteBuffer[] = {
  {"hex", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_9hex, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_11__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_13__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyBufferProcs __pyx_tp_as_buffer_WriteBuffer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_5__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_8asynctnt_6iproto_8protocol_11WriteBuffer_7__releasebuffer__, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.WriteBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_WriteBuffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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*/
  &__pyx_tp_as_buffer_WriteBuffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_WriteBuffer, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_WriteBuffer, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_ReadBuffer __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_ReadBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *p;
  PyObject *o;
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_ReadBuffer;
  p->encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_ReadBuffer(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->encoding);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_ReadBuffer[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_5__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_10ReadBuffer_7__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.ReadBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_ReadBuffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_ReadBuffer, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_ReadBuffer, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Request __pyx_vtable_8asynctnt_6iproto_8protocol_Request;

static struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *__pyx_freelist_8asynctnt_6iproto_8protocol_Request[256];
static int __pyx_freecount_8asynctnt_6iproto_8protocol_Request = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Request(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol_Request > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol_Request[--__pyx_freecount_8asynctnt_6iproto_8protocol_Request];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_Request;
  p->space = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None); Py_INCREF(Py_None);
  p->waiter = Py_None; Py_INCREF(Py_None);
  p->timeout_handle = Py_None; Py_INCREF(Py_None);
  p->response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Request(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->space);
  Py_CLEAR(p->waiter);
  Py_CLEAR(p->timeout_handle);
  Py_CLEAR(p->response);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol_Request < 256) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol_Request[__pyx_freecount_8asynctnt_6iproto_8protocol_Request++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_Request(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)o;
  if (p->space) {
    e = (*v)(((PyObject *)p->space), a); if (e) return e;
  }
  if (p->waiter) {
    e = (*v)(p->waiter, a); if (e) return e;
  }
  if (p->timeout_handle) {
    e = (*v)(p->timeout_handle, a); if (e) return e;
  }
  if (p->response) {
    e = (*v)(((PyObject *)p->response), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_Request(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)o;
  tmp = ((PyObject*)p->space);
  p->space = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->waiter);
  p->waiter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->timeout_handle);
  p->timeout_handle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->response);
  p->response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_Request[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_7Request_3__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_7Request_5__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_Request = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.Request", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Request, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  __pyx_pw_8asynctnt_6iproto_8protocol_7Request_1__repr__, /*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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol_Request, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_Request, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_Request, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_Request, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Response __pyx_vtable_8asynctnt_6iproto_8protocol_Response;

static struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *__pyx_freelist_8asynctnt_6iproto_8protocol_Response[256];
static int __pyx_freecount_8asynctnt_6iproto_8protocol_Response = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Response(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol_Response > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol_Response[--__pyx_freecount_8asynctnt_6iproto_8protocol_Response];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_Response;
  p->_errmsg = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_body = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fields = ((struct C_TntFields *)Py_None); Py_INCREF(Py_None);
  p->_autoincrement_ids = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_exception = Py_None; Py_INCREF(Py_None);
  p->_q = Py_None; Py_INCREF(Py_None);
  p->_push_event = Py_None; Py_INCREF(Py_None);
  p->_q_append = Py_None; Py_INCREF(Py_None);
  p->_q_popleft = Py_None; Py_INCREF(Py_None);
  p->_push_event_set = Py_None; Py_INCREF(Py_None);
  p->_push_event_clear = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_8Response_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Response(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_errmsg);
  Py_CLEAR(p->_body);
  Py_CLEAR(p->_encoding);
  Py_CLEAR(p->_fields);
  Py_CLEAR(p->_autoincrement_ids);
  Py_CLEAR(p->_exception);
  Py_CLEAR(p->_q);
  Py_CLEAR(p->_push_event);
  Py_CLEAR(p->_q_append);
  Py_CLEAR(p->_q_popleft);
  Py_CLEAR(p->_push_event_set);
  Py_CLEAR(p->_push_event_clear);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol_Response < 256) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol_Response[__pyx_freecount_8asynctnt_6iproto_8protocol_Response++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_Response(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)o;
  if (p->_body) {
    e = (*v)(p->_body, a); if (e) return e;
  }
  if (p->_fields) {
    e = (*v)(((PyObject *)p->_fields), a); if (e) return e;
  }
  if (p->_autoincrement_ids) {
    e = (*v)(p->_autoincrement_ids, a); if (e) return e;
  }
  if (p->_exception) {
    e = (*v)(p->_exception, a); if (e) return e;
  }
  if (p->_q) {
    e = (*v)(p->_q, a); if (e) return e;
  }
  if (p->_push_event) {
    e = (*v)(p->_push_event, a); if (e) return e;
  }
  if (p->_q_append) {
    e = (*v)(p->_q_append, a); if (e) return e;
  }
  if (p->_q_popleft) {
    e = (*v)(p->_q_popleft, a); if (e) return e;
  }
  if (p->_push_event_set) {
    e = (*v)(p->_push_event_set, a); if (e) return e;
  }
  if (p->_push_event_clear) {
    e = (*v)(p->_push_event_clear, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_Response(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)o;
  tmp = ((PyObject*)p->_body);
  p->_body = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fields);
  p->_fields = ((struct C_TntFields *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_autoincrement_ids);
  p->_autoincrement_ids = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_exception);
  p->_exception = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_q);
  p->_q = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_push_event);
  p->_push_event = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_q_append);
  p->_q_append = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_q_popleft);
  p->_q_popleft = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_push_event_set);
  p->_push_event_set = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_push_event_clear);
  p->_push_event_clear = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_8asynctnt_6iproto_8protocol_Response(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_sync(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_4sync_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_code(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_4code_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_return_code(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_11return_code_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_schema_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_9schema_id_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_errmsg(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_6errmsg_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_4body_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_encoding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_8encoding_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_rowcount(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_8rowcount_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response_autoincrement_ids(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_17autoincrement_ids_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response__q(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_2_q_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_8Response__push_event(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_8Response_11_push_event_1__get__(o);
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_Response[] = {
  {"done", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_8Response_5done, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_8Response_13__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_8Response_15__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8asynctnt_6iproto_8protocol_Response[] = {
  {(char *)"sync", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_sync, 0, (char *)"\n            Response's sync (incremental id) for the corresponding request\n        ", 0},
  {(char *)"code", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_code, 0, (char *)"\n            Response code (0 - success)\n        ", 0},
  {(char *)"return_code", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_return_code, 0, (char *)"\n            Response return code (It's essentially a code & 0x7FFF)\n        ", 0},
  {(char *)"schema_id", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_schema_id, 0, (char *)"\n            Current scema id in Tarantool\n        ", 0},
  {(char *)"errmsg", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_errmsg, 0, (char *)"\n            If self.code != 0 then errmsg contains an error message\n        ", 0},
  {(char *)"body", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_body, 0, (char *)"\n            Response body\n        ", 0},
  {(char *)"encoding", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_encoding, 0, (char *)"\n            Response encoding\n        ", 0},
  {(char *)"rowcount", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_rowcount, 0, (char *)0, 0},
  {(char *)"autoincrement_ids", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response_autoincrement_ids, 0, (char *)"\n            Response autoincrement ids\n        ", 0},
  {(char *)"_q", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response__q, 0, (char *)0, 0},
  {(char *)"_push_event", __pyx_getprop_8asynctnt_6iproto_8protocol_8Response__push_event, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Response = {
  __pyx_pw_8asynctnt_6iproto_8protocol_8Response_7__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_8asynctnt_6iproto_8protocol_Response, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Response = {
  __pyx_pw_8asynctnt_6iproto_8protocol_8Response_7__len__, /*mp_length*/
  __pyx_pw_8asynctnt_6iproto_8protocol_8Response_9__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_Response = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.Response", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Response, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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
  __pyx_pw_8asynctnt_6iproto_8protocol_8Response_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Response, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Response, /*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_HAVE_GC, /*tp_flags*/
  "\n        Response object for all the requests to Tarantool\n    ", /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol_Response, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_Response, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_8asynctnt_6iproto_8protocol_8Response_11__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_Response, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8asynctnt_6iproto_8protocol_Response, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_Response, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_Db __pyx_vtable_8asynctnt_6iproto_8protocol_Db;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_Db(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *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_8asynctnt_6iproto_8protocol_Db *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_Db;
  p->_protocol = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)Py_None); Py_INCREF(Py_None);
  p->_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8asynctnt_6iproto_8protocol_2Db_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Db(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_protocol);
  Py_CLEAR(p->_encoding);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_Db(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)o;
  if (p->_protocol) {
    e = (*v)(((PyObject *)p->_protocol), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_Db(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)o;
  tmp = ((PyObject*)p->_protocol);
  p->_protocol = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_Db[] = {
  {"ping", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_3ping, METH_VARARGS|METH_KEYWORDS, 0},
  {"call16", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_5call16, METH_VARARGS|METH_KEYWORDS, 0},
  {"call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_7call, METH_VARARGS|METH_KEYWORDS, 0},
  {"eval", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_9eval, METH_VARARGS|METH_KEYWORDS, 0},
  {"select", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_11select, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_13insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"replace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_15replace, METH_VARARGS|METH_KEYWORDS, 0},
  {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_17delete, METH_VARARGS|METH_KEYWORDS, 0},
  {"update", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_19update, METH_VARARGS|METH_KEYWORDS, 0},
  {"upsert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_21upsert, METH_VARARGS|METH_KEYWORDS, 0},
  {"sql", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_23sql, METH_VARARGS|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_25__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_2Db_27__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_Db = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.Db", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_Db, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_8asynctnt_6iproto_8protocol_Db, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_Db, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_Db, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_Db, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_PushIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *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_8asynctnt_6iproto_8protocol_PushIterator *)o);
  p->_fut = Py_None; Py_INCREF(Py_None);
  p->_request = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)Py_None); Py_INCREF(Py_None);
  p->_response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_PushIterator(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_fut);
  Py_CLEAR(p->_request);
  Py_CLEAR(p->_response);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_PushIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)o;
  if (p->_fut) {
    e = (*v)(p->_fut, a); if (e) return e;
  }
  if (p->_request) {
    e = (*v)(((PyObject *)p->_request), a); if (e) return e;
  }
  if (p->_response) {
    e = (*v)(((PyObject *)p->_response), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_PushIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator *)o;
  tmp = ((PyObject*)p->_fut);
  p->_fut = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_request);
  p->_request = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_response);
  p->_response = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_12PushIterator_response(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_8response_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_5__next__(self);}
static PyObject *__pyx_specialmethod___pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_7__aiter__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_7__aiter__(self);}
static PyObject *__pyx_specialmethod___pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_9__anext__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_9__anext__(self);}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_PushIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_5__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__aiter__", (PyCFunction)__pyx_specialmethod___pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_7__aiter__, METH_NOARGS|METH_COEXIST, 0},
  {"__anext__", (PyCFunction)__pyx_specialmethod___pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_9__anext__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_12__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_14__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8asynctnt_6iproto_8protocol_PushIterator[] = {
  {(char *)"response", __pyx_getprop_8asynctnt_6iproto_8protocol_12PushIterator_response, 0, (char *)"\n            Return current Response object. Might be handy to know if the\n            request is finished already while iterating over the PushIterator\n\n            :rtype: asynctnt.Response\n        ", 0},
  {0, 0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static __Pyx_PyAsyncMethodsStruct __pyx_tp_as_async_PushIterator = {
  0, /*am_await*/
  __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_7__aiter__, /*am_aiter*/
  __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_9__anext__, /*am_anext*/
};
#endif

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_PushIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.PushIterator", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_PushIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_PushIterator, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  &__pyx_tp_as_async_PushIterator, /*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_8asynctnt_6iproto_8protocol_PushIterator, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_PushIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_3__iter__, /*tp_iter*/
  __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_5__next__, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_PushIterator, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8asynctnt_6iproto_8protocol_PushIterator, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8asynctnt_6iproto_8protocol_12PushIterator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_PushIterator, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_CoreProtocol(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *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_8asynctnt_6iproto_8protocol_CoreProtocol *)o);
  p->__pyx_vtab = __pyx_vtabptr_8asynctnt_6iproto_8protocol_CoreProtocol;
  p->host = Py_None; Py_INCREF(Py_None);
  p->port = Py_None; Py_INCREF(Py_None);
  p->encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)Py_None); Py_INCREF(Py_None);
  p->version = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->salt = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_CoreProtocol(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->host);
  Py_CLEAR(p->port);
  Py_CLEAR(p->encoding);
  Py_CLEAR(p->rbuf);
  Py_CLEAR(p->version);
  Py_CLEAR(p->salt);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_CoreProtocol(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)o;
  if (p->host) {
    e = (*v)(p->host, a); if (e) return e;
  }
  if (p->port) {
    e = (*v)(p->port, a); if (e) return e;
  }
  if (p->rbuf) {
    e = (*v)(((PyObject *)p->rbuf), a); if (e) return e;
  }
  if (p->version) {
    e = (*v)(p->version, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_CoreProtocol(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *)o;
  tmp = ((PyObject*)p->host);
  p->host = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->port);
  p->port = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rbuf);
  p->rbuf = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->version);
  p->version = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_CoreProtocol[] = {
  {"is_connected", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_3is_connected, METH_NOARGS, 0},
  {"is_fully_connected", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_5is_fully_connected, METH_NOARGS, 0},
  {"get_version", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_7get_version, METH_NOARGS, 0},
  {"_parse_version", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_9_parse_version, METH_O, 0},
  {"data_received", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_11data_received, METH_O, 0},
  {"connection_made", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_13connection_made, METH_O, 0},
  {"connection_lost", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_15connection_lost, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_17__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12CoreProtocol_19__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.CoreProtocol", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_CoreProtocol, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_8asynctnt_6iproto_8protocol_CoreProtocol, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_CoreProtocol, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_CoreProtocol, /*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_8asynctnt_6iproto_8protocol_12CoreProtocol_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_CoreProtocol, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_BaseProtocol __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol_BaseProtocol(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *p;
  PyObject *o = __pyx_tp_new_8asynctnt_6iproto_8protocol_CoreProtocol(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8asynctnt_6iproto_8protocol_CoreProtocol*)__pyx_vtabptr_8asynctnt_6iproto_8protocol_BaseProtocol;
  p->loop = Py_None; Py_INCREF(Py_None);
  p->username = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->password = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->connected_fut = Py_None; Py_INCREF(Py_None);
  p->on_connection_made_cb = Py_None; Py_INCREF(Py_None);
  p->on_connection_lost_cb = Py_None; Py_INCREF(Py_None);
  p->_on_request_completed_cb = Py_None; Py_INCREF(Py_None);
  p->_on_request_timeout_cb = Py_None; Py_INCREF(Py_None);
  p->_reqs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_schema = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)Py_None); Py_INCREF(Py_None);
  p->_refetch_schema_future = Py_None; Py_INCREF(Py_None);
  p->_db = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)Py_None); Py_INCREF(Py_None);
  p->create_future = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_BaseProtocol(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->username);
  Py_CLEAR(p->password);
  Py_CLEAR(p->connected_fut);
  Py_CLEAR(p->on_connection_made_cb);
  Py_CLEAR(p->on_connection_lost_cb);
  Py_CLEAR(p->_on_request_completed_cb);
  Py_CLEAR(p->_on_request_timeout_cb);
  Py_CLEAR(p->_reqs);
  Py_CLEAR(p->_schema);
  Py_CLEAR(p->_refetch_schema_future);
  Py_CLEAR(p->_db);
  Py_CLEAR(p->create_future);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_CoreProtocol(o);
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol_BaseProtocol(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)o;
  e = __pyx_tp_traverse_8asynctnt_6iproto_8protocol_CoreProtocol(o, v, a); if (e) return e;
  if (p->loop) {
    e = (*v)(p->loop, a); if (e) return e;
  }
  if (p->connected_fut) {
    e = (*v)(p->connected_fut, a); if (e) return e;
  }
  if (p->on_connection_made_cb) {
    e = (*v)(p->on_connection_made_cb, a); if (e) return e;
  }
  if (p->on_connection_lost_cb) {
    e = (*v)(p->on_connection_lost_cb, a); if (e) return e;
  }
  if (p->_on_request_completed_cb) {
    e = (*v)(p->_on_request_completed_cb, a); if (e) return e;
  }
  if (p->_on_request_timeout_cb) {
    e = (*v)(p->_on_request_timeout_cb, a); if (e) return e;
  }
  if (p->_reqs) {
    e = (*v)(p->_reqs, a); if (e) return e;
  }
  if (p->_schema) {
    e = (*v)(((PyObject *)p->_schema), a); if (e) return e;
  }
  if (p->_refetch_schema_future) {
    e = (*v)(p->_refetch_schema_future, a); if (e) return e;
  }
  if (p->_db) {
    e = (*v)(((PyObject *)p->_db), a); if (e) return e;
  }
  if (p->create_future) {
    e = (*v)(p->create_future, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol_BaseProtocol(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)o;
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_CoreProtocol(o);
  tmp = ((PyObject*)p->loop);
  p->loop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->connected_fut);
  p->connected_fut = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->on_connection_made_cb);
  p->on_connection_made_cb = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->on_connection_lost_cb);
  p->on_connection_lost_cb = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_on_request_completed_cb);
  p->_on_request_completed_cb = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_on_request_timeout_cb);
  p->_on_request_timeout_cb = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_reqs);
  p->_reqs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_schema);
  p->_schema = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_refetch_schema_future);
  p->_refetch_schema_future = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_db);
  p->_db = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->create_future);
  p->create_future = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_12BaseProtocol_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_8asynctnt_6iproto_8protocol_12BaseProtocol_schema_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_9schema_id_1__get__(o);
}

static PyMethodDef __pyx_methods_8asynctnt_6iproto_8protocol_BaseProtocol[] = {
  {"_create_future_fallback", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_3_create_future_fallback, METH_NOARGS, 0},
  {"_on_request_timeout", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_5_on_request_timeout, METH_O, 0},
  {"_on_request_completed", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_7_on_request_completed, METH_O, 0},
  {"create_db", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_9create_db, METH_NOARGS, 0},
  {"get_common_db", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_11get_common_db, METH_NOARGS, 0},
  {"refetch_schema", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_13refetch_schema, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_15__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_17__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8asynctnt_6iproto_8protocol_BaseProtocol[] = {
  {(char *)"schema", __pyx_getprop_8asynctnt_6iproto_8protocol_12BaseProtocol_schema, 0, (char *)0, 0},
  {(char *)"schema_id", __pyx_getprop_8asynctnt_6iproto_8protocol_12BaseProtocol_schema_id, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.BaseProtocol", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol_BaseProtocol, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_8asynctnt_6iproto_8protocol_BaseProtocol, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol_BaseProtocol, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8asynctnt_6iproto_8protocol_BaseProtocol, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8asynctnt_6iproto_8protocol_BaseProtocol, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8asynctnt_6iproto_8protocol_12BaseProtocol_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol_BaseProtocol, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex[8];
static int __pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex[--__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex[__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.__pyx_scope_struct__hex", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr[--__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr[__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__[8];
static int __pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__[--__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ev);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_response);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__[__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ *)o;
  if (p->__pyx_v_ev) {
    e = (*v)(p->__pyx_v_ev, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_response) {
    e = (*v)(((PyObject *)p->__pyx_v_response), a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.__pyx_scope_struct_2___anext__", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth[8];
static int __pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth[--__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth[__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.__pyx_scope_struct_3__do_auth", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema[8];
static int __pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema = 0;

static PyObject *__pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema)))) {
    o = (PyObject*)__pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema[--__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema];
    memset(o, 0, sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema(PyObject *o) {
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_fut);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema)))) {
    __pyx_freelist_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema[__pyx_freecount_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema++] = ((struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *)o;
  if (p->__pyx_v_fut) {
    e = (*v)(p->__pyx_v_fut, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *p = (struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema *)o;
  tmp = ((PyObject*)p->__pyx_v_fut);
  p->__pyx_v_fut = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema = {
  PyVarObject_HEAD_INIT(0, 0)
  "asynctnt.iproto.protocol.__pyx_scope_struct_4__do_fetch_schema", /*tp_name*/
  sizeof(struct __pyx_obj_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  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_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema, /*tp_traverse*/
  __pyx_tp_clear_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_protocol(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_protocol},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "protocol",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_kp_u_02x, __pyx_k_02x, sizeof(__pyx_k_02x), 0, 1, 0, 0},
  {&__pyx_n_s_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 0, 1, 1},
  {&__pyx_n_u_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 1, 0, 1},
  {&__pyx_n_s_ALL, __pyx_k_ALL, sizeof(__pyx_k_ALL), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Available_Iterator_types, __pyx_k_Available_Iterator_types, sizeof(__pyx_k_Available_Iterator_types), 0, 0, 1, 0},
  {&__pyx_n_s_BITS_ALL_NOT_SET, __pyx_k_BITS_ALL_NOT_SET, sizeof(__pyx_k_BITS_ALL_NOT_SET), 0, 0, 1, 1},
  {&__pyx_n_s_BITS_ALL_SET, __pyx_k_BITS_ALL_SET, sizeof(__pyx_k_BITS_ALL_SET), 0, 0, 1, 1},
  {&__pyx_n_s_BITS_ANY_SET, __pyx_k_BITS_ANY_SET, sizeof(__pyx_k_BITS_ANY_SET), 0, 0, 1, 1},
  {&__pyx_n_s_BaseProtocol, __pyx_k_BaseProtocol, sizeof(__pyx_k_BaseProtocol), 0, 0, 1, 1},
  {&__pyx_n_s_BaseProtocol__do_auth_locals_on, __pyx_k_BaseProtocol__do_auth_locals_on, sizeof(__pyx_k_BaseProtocol__do_auth_locals_on), 0, 0, 1, 1},
  {&__pyx_n_s_BaseProtocol__do_fetch_schema_lo, __pyx_k_BaseProtocol__do_fetch_schema_lo, sizeof(__pyx_k_BaseProtocol__do_fetch_schema_lo), 0, 0, 1, 1},
  {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1},
  {&__pyx_n_s_CancelledError, __pyx_k_CancelledError, sizeof(__pyx_k_CancelledError), 0, 0, 1, 1},
  {&__pyx_kp_u_Cannot_pop_push_from_a_non_async, __pyx_k_Cannot_pop_push_from_a_non_async, sizeof(__pyx_k_Cannot_pop_push_from_a_non_async), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_use_iter_with_PushIterato, __pyx_k_Cannot_use_iter_with_PushIterato, sizeof(__pyx_k_Cannot_use_iter_with_PushIterato), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_use_next_with_PushIterato, __pyx_k_Cannot_use_next_with_PushIterato, sizeof(__pyx_k_Cannot_use_next_with_PushIterato), 0, 1, 0, 0},
  {&__pyx_n_s_ConnectionRefusedError, __pyx_k_ConnectionRefusedError, sizeof(__pyx_k_ConnectionRefusedError), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionResetError, __pyx_k_ConnectionResetError, sizeof(__pyx_k_ConnectionResetError), 0, 0, 1, 1},
  {&__pyx_n_s_CoreProtocol, __pyx_k_CoreProtocol, sizeof(__pyx_k_CoreProtocol), 0, 0, 1, 1},
  {&__pyx_kp_u_Creates_PushIterator_object_In, __pyx_k_Creates_PushIterator_object_In, sizeof(__pyx_k_Creates_PushIterator_object_In), 0, 1, 0, 0},
  {&__pyx_n_s_Db, __pyx_k_Db, sizeof(__pyx_k_Db), 0, 0, 1, 1},
  {&__pyx_kp_u_Deallocating_buffer_with_attache, __pyx_k_Deallocating_buffer_with_attache, sizeof(__pyx_k_Deallocating_buffer_with_attache), 0, 1, 0, 0},
  {&__pyx_n_s_EQ, __pyx_k_EQ, sizeof(__pyx_k_EQ), 0, 0, 1, 1},
  {&__pyx_kp_u_Error_happened_while_parsing_sch, __pyx_k_Error_happened_while_parsing_sch, sizeof(__pyx_k_Error_happened_while_parsing_sch), 0, 1, 0, 0},
  {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1},
  {&__pyx_kp_u_Field_d_of_space_s_is_not_in_spa, __pyx_k_Field_d_of_space_s_is_not_in_spa, sizeof(__pyx_k_Field_d_of_space_s_is_not_in_spa), 0, 1, 0, 0},
  {&__pyx_kp_u_Field_map_must_contain_at_least, __pyx_k_Field_map_must_contain_at_least, sizeof(__pyx_k_Field_map_must_contain_at_least), 0, 1, 0, 0},
  {&__pyx_kp_u_Field_map_must_contain_at_least_2, __pyx_k_Field_map_must_contain_at_least_2, sizeof(__pyx_k_Field_map_must_contain_at_least_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Field_not_found, __pyx_k_Field_not_found, sizeof(__pyx_k_Field_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Field_s_in_supplied_dict_is_unkn, __pyx_k_Field_s_in_supplied_dict_is_unkn, sizeof(__pyx_k_Field_s_in_supplied_dict_is_unkn), 0, 1, 0, 0},
  {&__pyx_n_s_Future, __pyx_k_Future, sizeof(__pyx_k_Future), 0, 0, 1, 1},
  {&__pyx_kp_u_Future_is_invalid_Make_sure_to_c, __pyx_k_Future_is_invalid_Make_sure_to_c, sizeof(__pyx_k_Future_is_invalid_Make_sure_to_c), 0, 1, 0, 0},
  {&__pyx_n_s_GE, __pyx_k_GE, sizeof(__pyx_k_GE), 0, 0, 1, 1},
  {&__pyx_n_s_GT, __pyx_k_GT, sizeof(__pyx_k_GT), 0, 0, 1, 1},
  {&__pyx_kp_u_Header_key_must_be_a_MP_UINT, __pyx_k_Header_key_must_be_a_MP_UINT, sizeof(__pyx_k_Header_key_must_be_a_MP_UINT), 0, 1, 0, 0},
  {&__pyx_n_s_IPPROTO_TCP, __pyx_k_IPPROTO_TCP, sizeof(__pyx_k_IPPROTO_TCP), 0, 0, 1, 1},
  {&__pyx_kp_u_Impossible_condition_happened_Pl, __pyx_k_Impossible_condition_happened_Pl, sizeof(__pyx_k_Impossible_condition_happened_Pl), 0, 1, 0, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x01, __pyx_k_Incompatible_checksums_s_vs_0x01, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x01), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x1c, __pyx_k_Incompatible_checksums_s_vs_0x1c, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x1c), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd6, __pyx_k_Incompatible_checksums_s_vs_0xd6, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd6), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf1, __pyx_k_Incompatible_checksums_s_vs_0xf1, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf1), 0, 0, 1, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_u_Index_must_be_either_str_or_int, __pyx_k_Index_must_be_either_str_or_int, sizeof(__pyx_k_Index_must_be_either_str_or_int), 0, 1, 0, 0},
  {&__pyx_kp_u_Index_not_found_in_space, __pyx_k_Index_not_found_in_space, sizeof(__pyx_k_Index_not_found_in_space), 0, 1, 0, 0},
  {&__pyx_kp_u_Index_s_not_found_in_space_s_s_C, __pyx_k_Index_s_not_found_in_space_s_s_C, sizeof(__pyx_k_Index_s_not_found_in_space_s_s_C), 0, 1, 0, 0},
  {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1},
  {&__pyx_n_s_Iterator, __pyx_k_Iterator, sizeof(__pyx_k_Iterator), 0, 0, 1, 1},
  {&__pyx_kp_u_Iterator_is_of_unsupported_type, __pyx_k_Iterator_is_of_unsupported_type, sizeof(__pyx_k_Iterator_is_of_unsupported_type), 0, 1, 0, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_LE, __pyx_k_LE, sizeof(__pyx_k_LE), 0, 0, 1, 1},
  {&__pyx_n_s_LT, __pyx_k_LT, sizeof(__pyx_k_LT), 0, 0, 1, 1},
  {&__pyx_kp_u_Lost_connection_to_Tarantool, __pyx_k_Lost_connection_to_Tarantool, sizeof(__pyx_k_Lost_connection_to_Tarantool), 0, 1, 0, 0},
  {&__pyx_kp_u_Lost_connection_to_Tarantool_2, __pyx_k_Lost_connection_to_Tarantool_2, sizeof(__pyx_k_Lost_connection_to_Tarantool_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Lost_connection_to_Tarantool_3, __pyx_k_Lost_connection_to_Tarantool_3, sizeof(__pyx_k_Lost_connection_to_Tarantool_3), 0, 1, 0, 0},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_NEIGHBOR, __pyx_k_NEIGHBOR, sizeof(__pyx_k_NEIGHBOR), 0, 0, 1, 1},
  {&__pyx_n_s_OVERLAPS, __pyx_k_OVERLAPS, sizeof(__pyx_k_OVERLAPS), 0, 0, 1, 1},
  {&__pyx_kp_u_Offset_incorrect_Got_use_len, __pyx_k_Offset_incorrect_Got_use_len, sizeof(__pyx_k_Offset_incorrect_Got_use_len), 0, 1, 0, 0},
  {&__pyx_kp_u_Operation_field_no_must_be_int_a, __pyx_k_Operation_field_no_must_be_int_a, sizeof(__pyx_k_Operation_field_no_must_be_int_a), 0, 1, 0, 0},
  {&__pyx_kp_u_Operation_field_no_must_be_of_ei, __pyx_k_Operation_field_no_must_be_of_ei, sizeof(__pyx_k_Operation_field_no_must_be_of_ei), 0, 1, 0, 0},
  {&__pyx_kp_u_Operation_length_must_be_at_leas, __pyx_k_Operation_length_must_be_at_leas, sizeof(__pyx_k_Operation_length_must_be_at_leas), 0, 1, 0, 0},
  {&__pyx_kp_u_Operation_type_must_of_a_str_or, __pyx_k_Operation_type_must_of_a_str_or, sizeof(__pyx_k_Operation_type_must_of_a_str_or), 0, 1, 0, 0},
  {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1},
  {&__pyx_kp_u_Part_len_must_be_2, __pyx_k_Part_len_must_be_2, sizeof(__pyx_k_Part_len_must_be_2), 0, 1, 0, 0},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_Protocol, __pyx_k_Protocol, sizeof(__pyx_k_Protocol), 0, 0, 1, 1},
  {&__pyx_n_s_PushIterator, __pyx_k_PushIterator, sizeof(__pyx_k_PushIterator), 0, 0, 1, 1},
  {&__pyx_n_s_PushIterator___anext, __pyx_k_PushIterator___anext, sizeof(__pyx_k_PushIterator___anext), 0, 0, 1, 1},
  {&__pyx_kp_u_PushIterator___init___line_8, __pyx_k_PushIterator___init___line_8, sizeof(__pyx_k_PushIterator___init___line_8), 0, 1, 0, 0},
  {&__pyx_n_s_REQ, __pyx_k_REQ, sizeof(__pyx_k_REQ), 0, 0, 1, 1},
  {&__pyx_n_s_ReadBuffer, __pyx_k_ReadBuffer, sizeof(__pyx_k_ReadBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_Request, __pyx_k_Request, sizeof(__pyx_k_Request), 0, 0, 1, 1},
  {&__pyx_kp_u_Request_op_sync_schema_id_push, __pyx_k_Request_op_sync_schema_id_push, sizeof(__pyx_k_Request_op_sync_schema_id_push), 0, 1, 0, 0},
  {&__pyx_n_s_Response, __pyx_k_Response, sizeof(__pyx_k_Response), 0, 0, 1, 1},
  {&__pyx_kp_u_Response_body_must_be_a_MP_MAP, __pyx_k_Response_body_must_be_a_MP_MAP, sizeof(__pyx_k_Response_body_must_be_a_MP_MAP), 0, 1, 0, 0},
  {&__pyx_kp_u_Response_header_must_be_a_MP_MAP, __pyx_k_Response_header_must_be_a_MP_MAP, sizeof(__pyx_k_Response_header_must_be_a_MP_MAP), 0, 1, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_Schema, __pyx_k_Schema, sizeof(__pyx_k_Schema), 0, 0, 1, 1},
  {&__pyx_n_s_SchemaDummyIndex, __pyx_k_SchemaDummyIndex, sizeof(__pyx_k_SchemaDummyIndex), 0, 0, 1, 1},
  {&__pyx_n_s_SchemaDummySpace, __pyx_k_SchemaDummySpace, sizeof(__pyx_k_SchemaDummySpace), 0, 0, 1, 1},
  {&__pyx_n_s_SchemaIndex, __pyx_k_SchemaIndex, sizeof(__pyx_k_SchemaIndex), 0, 0, 1, 1},
  {&__pyx_n_s_SchemaSpace, __pyx_k_SchemaSpace, sizeof(__pyx_k_SchemaSpace), 0, 0, 1, 1},
  {&__pyx_kp_u_Schema_fetch_timeout, __pyx_k_Schema_fetch_timeout, sizeof(__pyx_k_Schema_fetch_timeout), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_spaces, __pyx_k_Schema_spaces, sizeof(__pyx_k_Schema_spaces), 0, 1, 0, 0},
  {&__pyx_kp_u_Single_operation_must_be_a_tuple, __pyx_k_Single_operation_must_be_a_tuple, sizeof(__pyx_k_Single_operation_must_be_a_tuple), 0, 1, 0, 0},
  {&__pyx_kp_u_Space_must_be_either_str_or_int, __pyx_k_Space_must_be_either_str_or_int, sizeof(__pyx_k_Space_must_be_either_str_or_int), 0, 1, 0, 0},
  {&__pyx_kp_u_Space_not_found, __pyx_k_Space_not_found, sizeof(__pyx_k_Space_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Space_s_not_found_Creating_dummy, __pyx_k_Space_s_not_found_Creating_dummy, sizeof(__pyx_k_Space_s_not_found_Creating_dummy), 0, 1, 0, 0},
  {&__pyx_kp_u_Space_with_id_not_found, __pyx_k_Space_with_id_not_found, sizeof(__pyx_k_Space_with_id_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Splice_offset_must_be_int, __pyx_k_Splice_offset_must_be_int, sizeof(__pyx_k_Splice_offset_must_be_int), 0, 1, 0, 0},
  {&__pyx_kp_u_Splice_operation_must_have_lengt, __pyx_k_Splice_operation_must_have_lengt, sizeof(__pyx_k_Splice_operation_must_have_lengt), 0, 1, 0, 0},
  {&__pyx_kp_u_Splice_position_must_be_int, __pyx_k_Splice_position_must_be_int, sizeof(__pyx_k_Splice_position_must_be_int), 0, 1, 0, 0},
  {&__pyx_n_s_TCP_NODELAY, __pyx_k_TCP_NODELAY, sizeof(__pyx_k_TCP_NODELAY), 0, 0, 1, 1},
  {&__pyx_n_s_TarantoolDatabaseError, __pyx_k_TarantoolDatabaseError, sizeof(__pyx_k_TarantoolDatabaseError), 0, 0, 1, 1},
  {&__pyx_n_s_TarantoolNotConnectedError, __pyx_k_TarantoolNotConnectedError, sizeof(__pyx_k_TarantoolNotConnectedError), 0, 0, 1, 1},
  {&__pyx_n_s_TarantoolSchemaError, __pyx_k_TarantoolSchemaError, sizeof(__pyx_k_TarantoolSchemaError), 0, 0, 1, 1},
  {&__pyx_n_s_TarantoolTuple, __pyx_k_TarantoolTuple, sizeof(__pyx_k_TarantoolTuple), 0, 0, 1, 1},
  {&__pyx_kp_u_Tarantool_is_not_connected, __pyx_k_Tarantool_is_not_connected, sizeof(__pyx_k_Tarantool_is_not_connected), 0, 1, 0, 0},
  {&__pyx_kp_u_Tarantool_s_s_Authorization_fail, __pyx_k_Tarantool_s_s_Authorization_fail, sizeof(__pyx_k_Tarantool_s_s_Authorization_fail), 0, 1, 0, 0},
  {&__pyx_kp_u_Tarantool_s_s_Authorized_success, __pyx_k_Tarantool_s_s_Authorized_success, sizeof(__pyx_k_Tarantool_s_s_Authorized_success), 0, 1, 0, 0},
  {&__pyx_kp_u_Tarantool_s_s_Schema_fetch_faile, __pyx_k_Tarantool_s_s_Schema_fetch_faile, sizeof(__pyx_k_Tarantool_s_s_Schema_fetch_faile), 0, 1, 0, 0},
  {&__pyx_kp_u_Tarantool_s_s_Schema_fetch_succe, __pyx_k_Tarantool_s_s_Schema_fetch_succe, sizeof(__pyx_k_Tarantool_s_s_Schema_fetch_succe), 0, 1, 0, 0},
  {&__pyx_n_s_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 0, 1, 1},
  {&__pyx_kp_u_TntFields, __pyx_k_TntFields, sizeof(__pyx_k_TntFields), 0, 1, 0, 0},
  {&__pyx_n_s_TntFields_2, __pyx_k_TntFields_2, sizeof(__pyx_k_TntFields_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Tuple_must_be_an_array_when_deco, __pyx_k_Tuple_must_be_an_array_when_deco, sizeof(__pyx_k_Tuple_must_be_an_array_when_deco), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_u_Type_is_not_supported_for_encodi, __pyx_k_Type_is_not_supported_for_encodi, sizeof(__pyx_k_Type_is_not_supported_for_encodi), 0, 1, 0, 0},
  {&__pyx_kp_u_Unexpected_key_type_in_map_s, __pyx_k_Unexpected_key_type_in_map_s, sizeof(__pyx_k_Unexpected_key_type_in_map_s), 0, 1, 0, 0},
  {&__pyx_kp_u_Unexpected_obj_type_s, __pyx_k_Unexpected_obj_type_s, sizeof(__pyx_k_Unexpected_obj_type_s), 0, 1, 0, 0},
  {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1},
  {&__pyx_kp_u_Unknown_key_with_code_d_in_heade, __pyx_k_Unknown_key_with_code_d_in_heade, sizeof(__pyx_k_Unknown_key_with_code_d_in_heade), 0, 1, 0, 0},
  {&__pyx_kp_u_Unknown_update_operation_type, __pyx_k_Unknown_update_operation_type, sizeof(__pyx_k_Unknown_update_operation_type), 0, 1, 0, 0},
  {&__pyx_n_s_VERSION_STRING_REGEX, __pyx_k_VERSION_STRING_REGEX, sizeof(__pyx_k_VERSION_STRING_REGEX), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_WriteBuffer, __pyx_k_WriteBuffer, sizeof(__pyx_k_WriteBuffer), 0, 0, 1, 1},
  {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
  {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
  {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
  {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
  {&__pyx_kp_u__57, __pyx_k__57, sizeof(__pyx_k__57), 0, 1, 0, 0},
  {&__pyx_n_s_add_done_callback, __pyx_k_add_done_callback, sizeof(__pyx_k_add_done_callback), 0, 0, 1, 1},
  {&__pyx_n_s_anext, __pyx_k_anext, sizeof(__pyx_k_anext), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1},
  {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1},
  {&__pyx_n_s_asynctnt, __pyx_k_asynctnt, sizeof(__pyx_k_asynctnt), 0, 0, 1, 1},
  {&__pyx_n_s_asynctnt_exceptions, __pyx_k_asynctnt_exceptions, sizeof(__pyx_k_asynctnt_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_asynctnt_iproto_protocol, __pyx_k_asynctnt_iproto_protocol, sizeof(__pyx_k_asynctnt_iproto_protocol), 0, 0, 1, 1},
  {&__pyx_kp_s_asynctnt_iproto_protocol_pyx, __pyx_k_asynctnt_iproto_protocol_pyx, sizeof(__pyx_k_asynctnt_iproto_protocol_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_asynctnt_log, __pyx_k_asynctnt_log, sizeof(__pyx_k_asynctnt_log), 0, 0, 1, 1},
  {&__pyx_n_s_auto_refetch_schema, __pyx_k_auto_refetch_schema, sizeof(__pyx_k_auto_refetch_schema), 0, 0, 1, 1},
  {&__pyx_n_s_await, __pyx_k_await, sizeof(__pyx_k_await), 0, 0, 1, 1},
  {&__pyx_n_s_b64decode, __pyx_k_b64decode, sizeof(__pyx_k_b64decode), 0, 0, 1, 1},
  {&__pyx_n_s_base64, __pyx_k_base64, sizeof(__pyx_k_base64), 0, 0, 1, 1},
  {&__pyx_kp_u_body_data_type_must_be_a_MP_ARRA, __pyx_k_body_data_type_must_be_a_MP_ARRA, sizeof(__pyx_k_body_data_type_must_be_a_MP_ARRA), 0, 1, 0, 0},
  {&__pyx_n_s_call_later, __pyx_k_call_later, sizeof(__pyx_k_call_later), 0, 0, 1, 1},
  {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_cancelled, __pyx_k_cancelled, sizeof(__pyx_k_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closing, __pyx_k_closing, sizeof(__pyx_k_closing), 0, 0, 1, 1},
  {&__pyx_kp_u_code_type_must_be_a_MP_UINT, __pyx_k_code_type_must_be_a_MP_UINT, sizeof(__pyx_k_code_type_must_be_a_MP_UINT), 0, 1, 0, 0},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_connected_fut, __pyx_k_connected_fut, sizeof(__pyx_k_connected_fut), 0, 0, 1, 1},
  {&__pyx_n_s_create_future, __pyx_k_create_future, sizeof(__pyx_k_create_future), 0, 0, 1, 1},
  {&__pyx_n_s_create_future_fallback, __pyx_k_create_future_fallback, sizeof(__pyx_k_create_future_fallback), 0, 0, 1, 1},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_digest, __pyx_k_digest, sizeof(__pyx_k_digest), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
  {&__pyx_kp_u_encoding_must_be_either_str_or_b, __pyx_k_encoding_must_be_either_str_or_b, sizeof(__pyx_k_encoding_must_be_either_str_or_b), 0, 1, 0, 0},
  {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_kp_u_errstr_type_must_be_a_MP_STR, __pyx_k_errstr_type_must_be_a_MP_STR, sizeof(__pyx_k_errstr_type_must_be_a_MP_STR), 0, 1, 0, 0},
  {&__pyx_kp_u_exceeded_timeout, __pyx_k_exceeded_timeout, sizeof(__pyx_k_exceeded_timeout), 0, 1, 0, 0},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_n_s_expression, __pyx_k_expression, sizeof(__pyx_k_expression), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_family, __pyx_k_family, sizeof(__pyx_k_family), 0, 0, 1, 1},
  {&__pyx_n_s_fetch_schema, __pyx_k_fetch_schema, sizeof(__pyx_k_fetch_schema), 0, 0, 1, 1},
  {&__pyx_n_u_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 1, 0, 1},
  {&__pyx_kp_u_field_name_must_not_be_None, __pyx_k_field_name_must_not_be_None, sizeof(__pyx_k_field_name_must_not_be_None), 0, 1, 0, 0},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_func_name, __pyx_k_func_name, sizeof(__pyx_k_func_name), 0, 0, 1, 1},
  {&__pyx_n_s_fut, __pyx_k_fut, sizeof(__pyx_k_fut), 0, 0, 1, 1},
  {&__pyx_n_s_futures, __pyx_k_futures, sizeof(__pyx_k_futures), 0, 0, 1, 1},
  {&__pyx_n_s_gather, __pyx_k_gather, sizeof(__pyx_k_gather), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get_extra_info, __pyx_k_get_extra_info, sizeof(__pyx_k_get_extra_info), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
  {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1},
  {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1},
  {&__pyx_n_s_hex_locals_genexpr, __pyx_k_hex_locals_genexpr, sizeof(__pyx_k_hex_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_kp_u_id_name_engine, __pyx_k_id_name_engine, sizeof(__pyx_k_id_name_engine), 0, 1, 0, 0},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_indexes, __pyx_k_indexes, sizeof(__pyx_k_indexes), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_initial_read_buffer_size, __pyx_k_initial_read_buffer_size, sizeof(__pyx_k_initial_read_buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1},
  {&__pyx_kp_u_int_argument_required_for_Arithm, __pyx_k_int_argument_required_for_Arithm, sizeof(__pyx_k_int_argument_required_for_Arithm), 0, 1, 0, 0},
  {&__pyx_n_s_iterator, __pyx_k_iterator, sizeof(__pyx_k_iterator), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
  {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
  {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_on_authorized, __pyx_k_on_authorized, sizeof(__pyx_k_on_authorized), 0, 0, 1, 1},
  {&__pyx_n_s_on_connection_lost, __pyx_k_on_connection_lost, sizeof(__pyx_k_on_connection_lost), 0, 0, 1, 1},
  {&__pyx_n_s_on_connection_made, __pyx_k_on_connection_made, sizeof(__pyx_k_on_connection_made), 0, 0, 1, 1},
  {&__pyx_kp_u_on_data_received_expected_bytes, __pyx_k_on_data_received_expected_bytes, sizeof(__pyx_k_on_data_received_expected_bytes), 0, 1, 0, 0},
  {&__pyx_n_s_on_fetch, __pyx_k_on_fetch, sizeof(__pyx_k_on_fetch), 0, 0, 1, 1},
  {&__pyx_n_s_on_request_completed, __pyx_k_on_request_completed, sizeof(__pyx_k_on_request_completed), 0, 0, 1, 1},
  {&__pyx_n_s_on_request_timeout, __pyx_k_on_request_timeout, sizeof(__pyx_k_on_request_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_operations, __pyx_k_operations, sizeof(__pyx_k_operations), 0, 0, 1, 1},
  {&__pyx_n_s_parse_metadata, __pyx_k_parse_metadata, sizeof(__pyx_k_parse_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_parse_version, __pyx_k_parse_version, sizeof(__pyx_k_parse_version), 0, 0, 1, 1},
  {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_push_subscribe, __pyx_k_push_subscribe, sizeof(__pyx_k_push_subscribe), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_BaseProtocol, __pyx_k_pyx_unpickle_BaseProtocol, sizeof(__pyx_k_pyx_unpickle_BaseProtocol), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_CoreProtocol, __pyx_k_pyx_unpickle_CoreProtocol, sizeof(__pyx_k_pyx_unpickle_CoreProtocol), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_PushIterator, __pyx_k_pyx_unpickle_PushIterator, sizeof(__pyx_k_pyx_unpickle_PushIterator), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Request, __pyx_k_pyx_unpickle_Request, sizeof(__pyx_k_pyx_unpickle_Request), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_repr___locals_lambda, __pyx_k_repr___locals_lambda, sizeof(__pyx_k_repr___locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_req, __pyx_k_req, sizeof(__pyx_k_req), 0, 0, 1, 1},
  {&__pyx_n_u_req, __pyx_k_req, sizeof(__pyx_k_req), 0, 1, 0, 1},
  {&__pyx_n_s_request_timeout, __pyx_k_request_timeout, sizeof(__pyx_k_request_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_return_exceptions, __pyx_k_return_exceptions, sizeof(__pyx_k_return_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_rowcount, __pyx_k_rowcount, sizeof(__pyx_k_rowcount), 0, 0, 1, 1},
  {&__pyx_kp_u_s_Tarantool_s_d_s, __pyx_k_s_Tarantool_s_d_s, sizeof(__pyx_k_s_Tarantool_s_d_s), 0, 1, 0, 0},
  {&__pyx_n_s_schema_id, __pyx_k_schema_id, sizeof(__pyx_k_schema_id), 0, 0, 1, 1},
  {&__pyx_kp_u_schema_id_type_must_be_a_MP_UINT, __pyx_k_schema_id_type_must_be_a_MP_UINT, sizeof(__pyx_k_schema_id_type_must_be_a_MP_UINT), 0, 1, 0, 0},
  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_kp_u_sequence_must_be_either_list_or, __pyx_k_sequence_must_be_either_list_or, sizeof(__pyx_k_sequence_must_be_either_list_or), 0, 1, 0, 0},
  {&__pyx_kp_u_sequence_must_be_either_list_tup, __pyx_k_sequence_must_be_either_list_tup, sizeof(__pyx_k_sequence_must_be_either_list_tup), 0, 1, 0, 0},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
  {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1},
  {&__pyx_n_s_set_result, __pyx_k_set_result, sizeof(__pyx_k_set_result), 0, 0, 1, 1},
  {&__pyx_n_s_setsockopt, __pyx_k_setsockopt, sizeof(__pyx_k_setsockopt), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_sha1, __pyx_k_sha1, sizeof(__pyx_k_sha1), 0, 0, 1, 1},
  {&__pyx_kp_u_sid_id_name_type_unique, __pyx_k_sid_id_name_type_unique, sizeof(__pyx_k_sid_id_name_type_unique), 0, 1, 0, 0},
  {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1},
  {&__pyx_n_u_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 1, 0, 1},
  {&__pyx_n_s_space, __pyx_k_space, sizeof(__pyx_k_space), 0, 0, 1, 1},
  {&__pyx_n_s_spaces, __pyx_k_spaces, sizeof(__pyx_k_spaces), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 0, 0, 1, 1},
  {&__pyx_kp_u_sync_d_not_found, __pyx_k_sync_d_not_found, sizeof(__pyx_k_sync_d_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_sync_rowcount_data, __pyx_k_sync_rowcount_data, sizeof(__pyx_k_sync_rowcount_data), 0, 1, 0, 0},
  {&__pyx_kp_u_sync_type_must_be_a_MP_UINT, __pyx_k_sync_type_must_be_a_MP_UINT, sizeof(__pyx_k_sync_type_must_be_a_MP_UINT), 0, 1, 0, 0},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_kp_u_the_buffer_is_in_read_only_mode, __pyx_k_the_buffer_is_in_read_only_mode, sizeof(__pyx_k_the_buffer_is_in_read_only_mode), 0, 1, 0, 0},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_transport, __pyx_k_transport, sizeof(__pyx_k_transport), 0, 0, 1, 1},
  {&__pyx_n_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 1},
  {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_key_in_body_map_d, __pyx_k_unknown_key_in_body_map_d, sizeof(__pyx_k_unknown_key_in_body_map_d), 0, 1, 0, 0},
  {&__pyx_kp_u_unknown_key_in_metadata_decoding, __pyx_k_unknown_key_in_metadata_decoding, sizeof(__pyx_k_unknown_key_in_metadata_decoding), 0, 1, 0, 0},
  {&__pyx_kp_u_unknown_key_in_sql_info_decoding, __pyx_k_unknown_key_in_sql_info_decoding, sizeof(__pyx_k_unknown_key_in_sql_info_decoding), 0, 1, 0, 0},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 0, 1, 1},
  {&__pyx_kp_b_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 0, 0},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1},
  {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 32, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 204, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 39, __pyx_L1_error)
  __pyx_builtin_BufferError = __Pyx_GetBuiltinName(__pyx_n_s_BufferError); if (!__pyx_builtin_BufferError) __PYX_ERR(2, 67, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 106, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 411, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(3, 87, __pyx_L1_error)
  __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(3, 210, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(4, 35, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(5, 82, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "asynctnt/iproto/buffer.pyx":39
 * 
 *         if self._view_count:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 'Deallocating buffer with attached memoryviews')
 * 
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Deallocating_buffer_with_attache); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "asynctnt/iproto/buffer.pyx":67
 *     cdef inline _check_readonly(self):
 *         if self._view_count:
 *             raise BufferError('the buffer is in read-only mode')             # <<<<<<<<<<<<<<
 * 
 *     cdef inline len(self):
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_the_buffer_is_in_read_only_mode); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "asynctnt/iproto/buffer.pyx":406
 *         for operation in operations:
 *             if not isinstance(operation, (list, tuple)):
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Single operation must be a tuple or list')
 * 
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Single_operation_must_be_a_tuple); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "asynctnt/iproto/buffer.pyx":411
 *             op_len = <uint32_t>cpython.list.PyList_GET_SIZE(operation)
 *             if op_len < 3:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     'Operation length must be at least 3')
 * 
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Operation_length_must_be_at_leas); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "asynctnt/iproto/buffer.pyx":420
 *                 str_temp = <bytes>op_type_str
 *             else:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Operation type must of a str or bytes type')
 * 
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Operation_type_must_of_a_str_or); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "asynctnt/iproto/buffer.pyx":434
 *                         'no format declaration in space {}'.format(space.sid))
 *             else:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Operation field_no must be of either int or str type')
 * 
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Operation_field_no_must_be_of_ei); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "asynctnt/iproto/buffer.pyx":451
 *                 op_argument = operation[2]
 *                 if not isinstance(op_argument, int):
 *                     raise TypeError(             # <<<<<<<<<<<<<<
 *                         'int argument required for '
 *                         'Arithmetic and Delete operations'
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_int_argument_required_for_Arithm); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "asynctnt/iproto/buffer.pyx":493
 *                 op_argument = operation[4]
 *                 if not isinstance(splice_position_obj, int):
 *                     raise TypeError('Splice position must be int')             # <<<<<<<<<<<<<<
 *                 if not isinstance(splice_offset_obj, int):
 *                     raise TypeError('Splice offset must be int')
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Splice_position_must_be_int); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "asynctnt/iproto/buffer.pyx":495
 *                     raise TypeError('Splice position must be int')
 *                 if not isinstance(splice_offset_obj, int):
 *                     raise TypeError('Splice offset must be int')             # <<<<<<<<<<<<<<
 * 
 *                 splice_position = <uint32_t>splice_position_obj
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Splice_offset_must_be_int); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "asynctnt/iproto/response.pyx":61
 *     cdef inline object pop_push(self):
 *         if not self._push_subscribe:
 *             raise RuntimeError('Cannot pop push from a non-async response')             # <<<<<<<<<<<<<<
 * 
 *         push = self._q_popleft()
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pop_push_from_a_non_async); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "asynctnt/iproto/response.pyx":88
 *             if len(data) > 10:
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 *                     data[:5],             # <<<<<<<<<<<<<<
 *                     data[-2:]
 *                 ])
 */
  __pyx_slice__30 = PySlice_New(Py_None, __pyx_int_5, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__30);
  __Pyx_GIVEREF(__pyx_slice__30);

  /* "asynctnt/iproto/response.pyx":89
 *                 parts = map(lambda x: ', '.join(map(repr, x)), [
 *                     data[:5],
 *                     data[-2:]             # <<<<<<<<<<<<<<
 *                 ])
 * 
 */
  __pyx_slice__31 = PySlice_New(__pyx_int_neg_2, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(3, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__31);
  __Pyx_GIVEREF(__pyx_slice__31);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "asynctnt/iproto/response.pyx":291
 *         for i in range(size):
 *             if mp_typeof(b[0][0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     'Tuple must be an array when decoding as TarantoolTuple'
 *                 )
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_Tuple_must_be_an_array_when_deco); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(3, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "asynctnt/iproto/response.pyx":323
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover
 *         raise TypeError('Response header must be a MP_MAP')             # <<<<<<<<<<<<<<
 * 
 *     # parsing header
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_Response_header_must_be_a_MP_MAP); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(3, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "asynctnt/iproto/response.pyx":329
 *     for _ in range(size):
 *         if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *             raise TypeError('Header key must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *         key = mp_decode_uint(&b)
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_Header_key_must_be_a_MP_UINT); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(3, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "asynctnt/iproto/response.pyx":334
 *         if key == tarantool.IPROTO_REQUEST_TYPE:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('code type must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *             hdr.code = <uint32_t>mp_decode_uint(&b)
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_u_code_type_must_be_a_MP_UINT); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(3, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "asynctnt/iproto/response.pyx":340
 *         elif key == tarantool.IPROTO_SYNC:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('sync type must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *             hdr.sync = mp_decode_uint(&b)
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_sync_type_must_be_a_MP_UINT); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(3, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "asynctnt/iproto/response.pyx":345
 *         elif key == tarantool.IPROTO_SCHEMA_VERSION:
 *             if mp_typeof(b[0]) != MP_UINT:  # pragma: nocover
 *                 raise TypeError('schema_id type must be a MP_UINT')             # <<<<<<<<<<<<<<
 * 
 *             hdr.schema_id = mp_decode_uint(&b)
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_schema_id_type_must_be_a_MP_UINT); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "asynctnt/iproto/response.pyx":378
 * 
 *     if mp_typeof(b[0]) != MP_MAP:  # pragma: nocover
 *         raise TypeError('Response body must be a MP_MAP')             # <<<<<<<<<<<<<<
 * 
 *     size = mp_decode_map(&b)
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Response_body_must_be_a_MP_MAP); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "asynctnt/iproto/response.pyx":388
 *         if key == tarantool.IPROTO_ERROR:
 *             if mp_typeof(b[0]) != MP_STR:  # pragma: nocover
 *                 raise TypeError('errstr type must be a MP_STR')             # <<<<<<<<<<<<<<
 * 
 *             s = NULL
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_errstr_type_must_be_a_MP_STR); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "asynctnt/iproto/response.pyx":405
 *                 field_map_size = mp_decode_map(&b)
 *                 if field_map_size == 0:
 *                     raise RuntimeError('Field map must contain at least '             # <<<<<<<<<<<<<<
 *                                        '1 element - field_name')
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Field_map_must_contain_at_least); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(3, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "asynctnt/iproto/response.pyx":431
 * 
 *                 if field_name is None:
 *                     raise RuntimeError('field_name must not be None')             # <<<<<<<<<<<<<<
 * 
 *                 resp._fields.add(field_id, field_name)
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_field_name_must_not_be_None); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(3, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "asynctnt/iproto/response.pyx":438
 *             field_map_size = mp_decode_map(&b)
 *             if field_map_size == 0:
 *                 raise RuntimeError('Field map must contain at least '             # <<<<<<<<<<<<<<
 *                                    '1 element - rowcount')
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u_Field_map_must_contain_at_least_2); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "asynctnt/iproto/response.pyx":459
 *         elif key == tarantool.IPROTO_DATA:
 *             if mp_typeof(b[0]) != MP_ARRAY:  # pragma: nocover
 *                 raise TypeError('body data type must be a MP_ARRAY')             # <<<<<<<<<<<<<<
 *             data = _response_parse_body_data(&b, resp, req)
 *             if is_chunk:
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_u_body_data_type_must_be_a_MP_ARRA); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "asynctnt/iproto/push.pyx":35
 *             Request request
 *         if not hasattr(fut, '_req'):
 *             raise ValueError('Future is invalid. Make sure to call with '             # <<<<<<<<<<<<<<
 *                              'a future returned from a method with '
 *                              'push_subscribe=True flag')
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_u_Future_is_invalid_Make_sure_to_c); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "asynctnt/iproto/push.pyx":51
 * 
 *     def __iter__(self):
 *         raise RuntimeError('Cannot use iter with PushIterator - use aiter')             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_u_Cannot_use_iter_with_PushIterato); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(4, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "asynctnt/iproto/push.pyx":54
 * 
 *     def __next__(self):
 *         raise RuntimeError('Cannot use next with PushIterator - use anext')             # <<<<<<<<<<<<<<
 * 
 *     def __aiter__(self):
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u_Cannot_use_next_with_PushIterato); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(4, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "asynctnt/iproto/coreproto.pyx":33
 *             self.encoding = encoding
 *         else:
 *             raise TypeError('encoding must be either str or bytes')             # <<<<<<<<<<<<<<
 * 
 *         initial_read_buffer_size = initial_read_buffer_size or 0x20000
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_encoding_must_be_either_str_or_b); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(10, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "asynctnt/iproto/coreproto.pyx":75
 * 
 *         if not cpython.PyBytes_CheckExact(data):
 *             raise BufferError('_on_data_received: expected bytes object')             # <<<<<<<<<<<<<<
 * 
 *         data_str = NULL
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_on_data_received_expected_bytes); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(10, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "asynctnt/iproto/coreproto.pyx":133
 *             self.rbuf.get_slice(ver_length,
 *                                 ver_length + SALT_LENGTH)
 *         )[:SCRAMBLE_SIZE]             # <<<<<<<<<<<<<<
 *         self.state = PROTOCOL_NORMAL
 *         self._on_greeting_received()
 */
  __pyx_slice__56 = PySlice_New(Py_None, __pyx_int_20, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(10, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__56);
  __Pyx_GIVEREF(__pyx_slice__56);

  /* "asynctnt/iproto/protocol.pyx":192
 *         fut = self._db._auth(self.salt, username, password, 0, False)
 * 
 *         def on_authorized(f):             # <<<<<<<<<<<<<<
 *             if f.cancelled():
 *                 self._set_connection_error(asyncio.futures.CancelledError())
 */
  __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_f, __pyx_n_s_e); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(5, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asynctnt_iproto_protocol_pyx, __pyx_n_s_on_authorized, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(5, 192, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":218
 *         self._schema_fetch_in_progress = True
 * 
 *         def on_fetch(f):             # <<<<<<<<<<<<<<
 *             self._schema_fetch_in_progress = False
 * 
 */
  __pyx_tuple__60 = PyTuple_Pack(4, __pyx_n_s_f, __pyx_n_s_e, __pyx_n_s_spaces, __pyx_n_s_indexes); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(5, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asynctnt_iproto_protocol_pyx, __pyx_n_s_on_fetch, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(5, 218, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":262
 * 
 *         self._schema_id = -1
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)             # <<<<<<<<<<<<<<
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_int_281); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "asynctnt/iproto/protocol.pyx":263
 *         self._schema_id = -1
 *         fut_vspace = self._db.select(SPACE_VSPACE, timeout=0)
 *         fut_vindex = self._db.select(SPACE_VINDEX, timeout=0)             # <<<<<<<<<<<<<<
 *         gather_fut = asyncio.gather(fut_vspace, fut_vindex,
 *                                     return_exceptions=False)
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_int_289); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "asynctnt/iproto/protocol.pyx":392
 *             return Iterator[iterator]
 *         else:
 *             raise TypeError('Iterator is of unsupported type '             # <<<<<<<<<<<<<<
 *                             '(asynctnt.Iterator, int, str)')
 * 
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_Iterator_is_of_unsupported_type); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(5, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "asynctnt/iproto/coreproto.pyx":16
 * from asynctnt.log import logger
 * 
 * VERSION_STRING_REGEX = re.compile(r'\s*Tarantool\s+([\d.]+)\s+.*')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_u_s_Tarantool_s_d_s); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Request(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Request, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__68 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_PushIterator, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CoreProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__72 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BaseProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(5, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_281 = PyInt_FromLong(281); if (unlikely(!__pyx_int_281)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_289 = PyInt_FromLong(289); if (unlikely(!__pyx_int_289)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_2045263 = PyInt_FromLong(2045263L); if (unlikely(!__pyx_int_2045263)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_29796805 = PyInt_FromLong(29796805L); if (unlikely(!__pyx_int_29796805)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_225261924 = PyInt_FromLong(225261924L); if (unlikely(!__pyx_int_225261924)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_253265777 = PyInt_FromLong(253265777L); if (unlikely(!__pyx_int_253265777)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(5, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("encode_unicode_string", (void (*)(void))__pyx_f_8asynctnt_6iproto_8protocol_encode_unicode_string, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("decode_string", (void (*)(void))__pyx_f_8asynctnt_6iproto_8protocol_decode_string, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dict_to_list_fields", (void (*)(void))__pyx_f_8asynctnt_6iproto_8protocol_dict_to_list_fields, "PyObject *(PyObject *, struct C_TntFields *, int)") < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("response_parse_header", (void (*)(void))__pyx_f_8asynctnt_6iproto_8protocol_response_parse_header, "Py_ssize_t (char const *, uint32_t, struct __pyx_t_8asynctnt_6iproto_8protocol_Header *)") < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("response_parse_body", (void (*)(void))__pyx_f_8asynctnt_6iproto_8protocol_response_parse_body, "Py_ssize_t (char const *, uint32_t, struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, int)") < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_TntFields = &__pyx_vtable_8asynctnt_6iproto_8protocol_TntFields;
  __pyx_vtable_8asynctnt_6iproto_8protocol_TntFields.len = (int (*)(struct C_TntFields *))__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_len;
  __pyx_vtable_8asynctnt_6iproto_8protocol_TntFields.add = (void (*)(struct C_TntFields *, uint64_t, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_add;
  __pyx_vtable_8asynctnt_6iproto_8protocol_TntFields.name_by_id = (PyObject *(*)(struct C_TntFields *, int))__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_name_by_id;
  __pyx_vtable_8asynctnt_6iproto_8protocol_TntFields.id_by_name = (uint64_t (*)(struct C_TntFields *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_9TntFields_id_by_name;
  if (PyType_Ready(&C_TntFields_Type) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  C_TntFields_Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!C_TntFields_Type.tp_dictoffset && C_TntFields_Type.tp_getattro == PyObject_GenericGetAttr)) {
    C_TntFields_Type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  if (__Pyx_SetVtable(C_TntFields_Type.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_TntFields) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TntFields_2, (PyObject *)&C_TntFields_Type) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&C_TntFields_Type) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_TntFields = &C_TntFields_Type;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SchemaIndex, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaIndex = &__pyx_type_8asynctnt_6iproto_8protocol_SchemaIndex;
  __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex.tp_base = __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaIndex;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SchemaDummyIndex, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaDummyIndex = &__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummyIndex;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaSpace = &__pyx_vtable_8asynctnt_6iproto_8protocol_SchemaSpace;
  __pyx_vtable_8asynctnt_6iproto_8protocol_SchemaSpace.add_index = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *))__pyx_f_8asynctnt_6iproto_8protocol_11SchemaSpace_add_index;
  __pyx_vtable_8asynctnt_6iproto_8protocol_SchemaSpace.get_index = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index *__pyx_optional_args))__pyx_f_8asynctnt_6iproto_8protocol_11SchemaSpace_get_index;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaSpace) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SchemaSpace, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace = &__pyx_type_8asynctnt_6iproto_8protocol_SchemaSpace;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaDummySpace = &__pyx_vtable_8asynctnt_6iproto_8protocol_SchemaDummySpace;
  __pyx_vtable_8asynctnt_6iproto_8protocol_SchemaDummySpace.__pyx_base = *__pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaSpace;
  __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace.tp_base = __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaSpace;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_SchemaDummySpace) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SchemaDummySpace, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_SchemaDummySpace = &__pyx_type_8asynctnt_6iproto_8protocol_SchemaDummySpace;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_Schema = &__pyx_vtable_8asynctnt_6iproto_8protocol_Schema;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.get_space = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_get_space;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.create_dummy_space = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, int))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_create_dummy_space;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.get_or_create_space = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_get_or_create_space;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.parse_space = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse_space;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.parse_index = (struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse_index;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.clear = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_clear;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Schema.parse = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Schema *(*)(int64_t, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_6Schema_parse;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_Schema) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_Schema.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_Schema.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_Schema.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_Schema.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_Schema.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_Schema) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Schema, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_Schema) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_Schema) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_Schema = &__pyx_type_8asynctnt_6iproto_8protocol_Schema;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_WriteBuffer = &__pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.new = (struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *(*)(PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_new;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._check_readonly = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__check_readonly;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.len = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_len;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.ensure_allocated = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, Py_ssize_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_ensure_allocated;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._ensure_allocated = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, Py_ssize_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__ensure_allocated;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._reallocate = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, Py_ssize_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__reallocate;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.write_buffer = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_buffer;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.write_header = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, uint64_t, enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, int64_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_header;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.change_schema_id = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, int64_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_change_schema_id;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.write_length = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_write_length;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_nil = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_nil;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_bool = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, int))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bool;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_double = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, double))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_double;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_uint = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint64_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_uint;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_int = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, int64_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_int;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_str = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, char const *, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_str;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_bin = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, char const *, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_bin;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_array = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_array;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_map = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_map;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_list = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_list;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_tuple = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_tuple;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_dict = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_dict;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_key_sequence = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence *__pyx_optional_args))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_key_sequence;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_obj = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_obj;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer._encode_update_ops = (char *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, char *, PyObject *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer__encode_update_ops;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_call = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_call;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_eval = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_eval;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_select = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, uint64_t, uint64_t, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_select;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_insert = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_insert;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_delete = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_delete;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_update = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update *__pyx_optional_args))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_update;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_upsert = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_upsert;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_sql = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_sql;
  __pyx_vtable_8asynctnt_6iproto_8protocol_WriteBuffer.encode_request_auth = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_11WriteBuffer_encode_request_auth;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_WriteBuffer) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WriteBuffer, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_WriteBuffer = &__pyx_type_8asynctnt_6iproto_8protocol_WriteBuffer;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_ReadBuffer = &__pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.new = (struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *(*)(PyObject *, struct __pyx_opt_args_8asynctnt_6iproto_8protocol_10ReadBuffer_new *__pyx_optional_args))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_new;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer._reallocate = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer__reallocate;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.extend = (int (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, char const *, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_extend;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.move = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.move_offset = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, Py_ssize_t, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_move_offset;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.get_slice = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.get_slice_begin = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_begin;
  __pyx_vtable_8asynctnt_6iproto_8protocol_ReadBuffer.get_slice_end = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_ReadBuffer *, size_t))__pyx_f_8asynctnt_6iproto_8protocol_10ReadBuffer_get_slice_end;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer) < 0) __PYX_ERR(7, 10, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_ReadBuffer) < 0) __PYX_ERR(7, 10, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ReadBuffer, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer) < 0) __PYX_ERR(7, 10, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer) < 0) __PYX_ERR(7, 10, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_ReadBuffer = &__pyx_type_8asynctnt_6iproto_8protocol_ReadBuffer;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_Request = &__pyx_vtable_8asynctnt_6iproto_8protocol_Request;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Request.new = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *(*)(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, uint64_t, int64_t, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, int))__pyx_f_8asynctnt_6iproto_8protocol_7Request_new;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Request.fields = (struct C_TntFields *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *))__pyx_f_8asynctnt_6iproto_8protocol_7Request_fields;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_Request) < 0) __PYX_ERR(8, 7, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_Request.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_Request.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_Request.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_Request.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_Request.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_Request) < 0) __PYX_ERR(8, 7, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Request, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_Request) < 0) __PYX_ERR(8, 7, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_Request) < 0) __PYX_ERR(8, 7, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_Request = &__pyx_type_8asynctnt_6iproto_8protocol_Request;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_Response = &__pyx_vtable_8asynctnt_6iproto_8protocol_Response;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.is_error = (int (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_is_error;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response._len = (uint32_t (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *))__pyx_f_8asynctnt_6iproto_8protocol_8Response__len;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.add_push = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_add_push;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.pop_push = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_pop_push;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.push_len = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_push_len;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.set_data = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_set_data;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.set_exception = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_set_exception;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.get_exception = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_get_exception;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Response.notify = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Response *))__pyx_f_8asynctnt_6iproto_8protocol_8Response_notify;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_Response) < 0) __PYX_ERR(3, 17, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_Response.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_Response.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_Response.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_Response.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_Response.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_Response) < 0) __PYX_ERR(3, 17, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Response, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_Response) < 0) __PYX_ERR(3, 17, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_Response) < 0) __PYX_ERR(3, 17, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_Response = &__pyx_type_8asynctnt_6iproto_8protocol_Response;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_Db = &__pyx_vtable_8asynctnt_6iproto_8protocol_Db;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db.new = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_2Db_new;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db.next_sync = (uint64_t (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *))__pyx_f_8asynctnt_6iproto_8protocol_2Db_next_sync;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._ping = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__ping;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._call16 = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__call16;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._call = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__call;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._eval = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__eval;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._select = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, uint64_t, uint64_t, uint32_t, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__select;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._insert = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, int, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__insert;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._delete = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__delete;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._update = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaIndex *, PyObject *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__update;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._upsert = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, struct __pyx_obj_8asynctnt_6iproto_8protocol_SchemaSpace *, PyObject *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__upsert;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._sql = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, int, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__sql;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._auth = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *, PyObject *, PyObject *, PyObject *, float, int))__pyx_f_8asynctnt_6iproto_8protocol_2Db__auth;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._sha1 = (PyObject *(*)(PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_2Db__sha1;
  __pyx_vtable_8asynctnt_6iproto_8protocol_Db._strxor = (PyObject *(*)(PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_2Db__strxor;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_Db) < 0) __PYX_ERR(9, 5, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_Db.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_Db.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_Db.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_Db.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_Db.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_Db) < 0) __PYX_ERR(9, 5, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Db, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_Db) < 0) __PYX_ERR(9, 5, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_Db) < 0) __PYX_ERR(9, 5, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_Db = &__pyx_type_8asynctnt_6iproto_8protocol_Db;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_PushIterator) < 0) __PYX_ERR(4, 7, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_PushIterator.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_PushIterator.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_PushIterator.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_PushIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_PushIterator, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(4, 7, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_8asynctnt_6iproto_8protocol_12PushIterator___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_8asynctnt_6iproto_8protocol_12PushIterator___init__.doc = __pyx_doc_8asynctnt_6iproto_8protocol_12PushIterator___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8asynctnt_6iproto_8protocol_12PushIterator___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PushIterator, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_PushIterator) < 0) __PYX_ERR(4, 7, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_PushIterator) < 0) __PYX_ERR(4, 7, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_PushIterator = &__pyx_type_8asynctnt_6iproto_8protocol_PushIterator;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_CoreProtocol = &__pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._is_connected = (int (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__is_connected;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._is_fully_connected = (int (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__is_fully_connected;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._write = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__write;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._on_data_received = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_data_received;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._process__greeting = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__process__greeting;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._on_greeting_received = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_greeting_received;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._on_response_received = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, char const *, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_response_received;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._on_connection_made = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_made;
  __pyx_vtable_8asynctnt_6iproto_8protocol_CoreProtocol._on_connection_lost = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12CoreProtocol__on_connection_lost;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol) < 0) __PYX_ERR(10, 19, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_CoreProtocol) < 0) __PYX_ERR(10, 19, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CoreProtocol, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol) < 0) __PYX_ERR(10, 19, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol) < 0) __PYX_ERR(10, 19, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_CoreProtocol = &__pyx_type_8asynctnt_6iproto_8protocol_CoreProtocol;
  __pyx_vtabptr_8asynctnt_6iproto_8protocol_BaseProtocol = &__pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.__pyx_base = *__pyx_vtabptr_8asynctnt_6iproto_8protocol_CoreProtocol;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.__pyx_base._on_greeting_received = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_greeting_received;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.__pyx_base._on_response_received = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, char const *, uint32_t))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_response_received;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.__pyx_base._on_connection_made = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_connection_made;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.__pyx_base._on_connection_lost = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_CoreProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__on_connection_lost;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._set_connection_ready = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__set_connection_ready;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._set_connection_error = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__set_connection_error;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._do_auth = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__do_auth;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._do_fetch_schema = (void (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__do_fetch_schema;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._refetch_schema = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__refetch_schema;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.next_sync = (uint64_t (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_next_sync;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.transform_iterator = (uint32_t (*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, PyObject *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_transform_iterator;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._new_waiter_for_request = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, float))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__new_waiter_for_request;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol._create_db = (struct __pyx_obj_8asynctnt_6iproto_8protocol_Db *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol__create_db;
  __pyx_vtable_8asynctnt_6iproto_8protocol_BaseProtocol.execute = (PyObject *(*)(struct __pyx_obj_8asynctnt_6iproto_8protocol_BaseProtocol *, struct __pyx_obj_8asynctnt_6iproto_8protocol_Request *, struct __pyx_obj_8asynctnt_6iproto_8protocol_WriteBuffer *, float))__pyx_f_8asynctnt_6iproto_8protocol_12BaseProtocol_execute;
  __pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol.tp_base = __pyx_ptype_8asynctnt_6iproto_8protocol_CoreProtocol;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol) < 0) __PYX_ERR(5, 42, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol.tp_dict, __pyx_vtabptr_8asynctnt_6iproto_8protocol_BaseProtocol) < 0) __PYX_ERR(5, 42, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseProtocol, (PyObject *)&__pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol) < 0) __PYX_ERR(5, 42, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol) < 0) __PYX_ERR(5, 42, __pyx_L1_error)
  __pyx_ptype_8asynctnt_6iproto_8protocol_BaseProtocol = &__pyx_type_8asynctnt_6iproto_8protocol_BaseProtocol;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex) < 0) __PYX_ERR(2, 54, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex = &__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct__hex;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(2, 55, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr = &__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__) < 0) __PYX_ERR(4, 60, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__ = &__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_2___anext__;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth) < 0) __PYX_ERR(5, 188, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth = &__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_3__do_auth;
  if (PyType_Ready(&__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema) < 0) __PYX_ERR(5, 212, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema.tp_dictoffset && __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema = &__pyx_type_8asynctnt_6iproto_8protocol___pyx_scope_struct_4__do_fetch_schema;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(12, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initprotocol(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initprotocol(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_protocol(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_protocol(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_protocol(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyTypeObject *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'protocol' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #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("__Pyx_PyMODINIT_FUNC PyInit_protocol(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(5, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(5, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(5, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("protocol", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(5, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(5, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(5, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(5, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(5, 1, __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_ERR(5, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_asynctnt__iproto__protocol) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(5, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "asynctnt.iproto.protocol")) {
      if (unlikely(PyDict_SetItemString(modules, "asynctnt.iproto.protocol", __pyx_m) < 0)) __PYX_ERR(5, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(5, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(5, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(5, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  #endif

  /* "asynctnt/iproto/protocol.pyx":5
 * cimport cpython.dict
 * 
 * import asyncio             # <<<<<<<<<<<<<<
 * import enum
 * 
 */
  __pyx_t_1 = __Pyx_patch_asyncio(__Pyx_Import(__pyx_n_s_asyncio, 0, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_1) < 0) __PYX_ERR(5, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":6
 * 
 * import asyncio
 * import enum             # <<<<<<<<<<<<<<
 * 
 * from asynctnt.exceptions import TarantoolNotConnectedError
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(5, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/protocol.pyx":8
 * import enum
 * 
 * from asynctnt.exceptions import TarantoolNotConnectedError             # <<<<<<<<<<<<<<
 * 
 * include "const.pxi"
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_TarantoolNotConnectedError);
  __Pyx_GIVEREF(__pyx_n_s_TarantoolNotConnectedError);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_TarantoolNotConnectedError);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_asynctnt_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 8, __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_TarantoolNotConnectedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TarantoolNotConnectedError, __pyx_t_1) < 0) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/schema.pyx":3
 * # cython: profile=True
 * 
 * from asynctnt.exceptions import TarantoolSchemaError             # <<<<<<<<<<<<<<
 * from asynctnt.log import logger
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_TarantoolSchemaError);
  __Pyx_GIVEREF(__pyx_n_s_TarantoolSchemaError);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_TarantoolSchemaError);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_asynctnt_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __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_TarantoolSchemaError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TarantoolSchemaError, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/schema.pyx":4
 * 
 * from asynctnt.exceptions import TarantoolSchemaError
 * from asynctnt.log import logger             # <<<<<<<<<<<<<<
 * 
 * from libc.stdint cimport int32_t, uint64_t
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_logger);
  __Pyx_GIVEREF(__pyx_n_s_logger);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logger);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_asynctnt_log, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __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_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/response.pyx":1
 * import asyncio             # <<<<<<<<<<<<<<
 * import collections
 * from typing import Optional
 */
  __pyx_t_2 = __Pyx_patch_asyncio(__Pyx_Import(__pyx_n_s_asyncio, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_2) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/response.pyx":2
 * import asyncio
 * import collections             # <<<<<<<<<<<<<<
 * from typing import Optional
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(3, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/response.pyx":3
 * import asyncio
 * import collections
 * from typing import Optional             # <<<<<<<<<<<<<<
 * 
 * cimport cpython
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Optional);
  __Pyx_GIVEREF(__pyx_n_s_Optional);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Optional);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3, __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_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(3, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/response.pyx":12
 * from libc cimport stdio
 * 
 * from asynctnt.log import logger             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_logger);
  __Pyx_GIVEREF(__pyx_n_s_logger);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logger);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_asynctnt_log, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __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_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/db.pyx":3
 * cimport cpython
 * 
 * import hashlib             # <<<<<<<<<<<<<<
 * 
 * cdef class Db:
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_hashlib, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib, __pyx_t_2) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/push.pyx":1
 * import asyncio             # <<<<<<<<<<<<<<
 * 
 * cimport cython
 */
  __pyx_t_2 = __Pyx_patch_asyncio(__Pyx_Import(__pyx_n_s_asyncio, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/push.pyx":5
 * cimport cython
 * 
 * import asynctnt             # <<<<<<<<<<<<<<
 * 
 * cdef class PushIterator:
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_asynctnt, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asynctnt, __pyx_t_2) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/coreproto.pyx":8
 * from libc.stdint cimport uint32_t, uint64_t
 * 
 * import base64             # <<<<<<<<<<<<<<
 * import socket
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_base64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_base64, __pyx_t_2) < 0) __PYX_ERR(10, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/coreproto.pyx":9
 * 
 * import base64
 * import socket             # <<<<<<<<<<<<<<
 * 
 * import re
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_socket, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_2) < 0) __PYX_ERR(10, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/coreproto.pyx":11
 * import socket
 * 
 * import re             # <<<<<<<<<<<<<<
 * 
 * from asynctnt.exceptions import TarantoolDatabaseError
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(10, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/coreproto.pyx":13
 * import re
 * 
 * from asynctnt.exceptions import TarantoolDatabaseError             # <<<<<<<<<<<<<<
 * from asynctnt.log import logger
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_TarantoolDatabaseError);
  __Pyx_GIVEREF(__pyx_n_s_TarantoolDatabaseError);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_TarantoolDatabaseError);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_asynctnt_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 13, __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_TarantoolDatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TarantoolDatabaseError, __pyx_t_2) < 0) __PYX_ERR(10, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asynctnt/iproto/coreproto.pyx":14
 * 
 * from asynctnt.exceptions import TarantoolDatabaseError
 * from asynctnt.log import logger             # <<<<<<<<<<<<<<
 * 
 * VERSION_STRING_REGEX = re.compile(r'\s*Tarantool\s+([\d.]+)\s+.*')
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_logger);
  __Pyx_GIVEREF(__pyx_n_s_logger);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logger);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_asynctnt_log, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 14, __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_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(10, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/coreproto.pyx":16
 * from asynctnt.log import logger
 * 
 * VERSION_STRING_REGEX = re.compile(r'\s*Tarantool\s+([\d.]+)\s+.*')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_STRING_REGEX, __pyx_t_2) < 0) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":24
 * 
 * 
 * class Iterator(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     """
 *         Available Iterator types
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 24, __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 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Iterator, __pyx_n_s_Iterator, (PyObject *) NULL, __pyx_n_s_asynctnt_iproto_protocol, __pyx_kp_s_Available_Iterator_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "asynctnt/iproto/protocol.pyx":28
 *         Available Iterator types
 *     """
 *     EQ = 0             # <<<<<<<<<<<<<<
 *     REQ = 1
 *     ALL = 2
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EQ, __pyx_int_0) < 0) __PYX_ERR(5, 28, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":29
 *     """
 *     EQ = 0
 *     REQ = 1             # <<<<<<<<<<<<<<
 *     ALL = 2
 *     LT = 3
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_REQ, __pyx_int_1) < 0) __PYX_ERR(5, 29, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":30
 *     EQ = 0
 *     REQ = 1
 *     ALL = 2             # <<<<<<<<<<<<<<
 *     LT = 3
 *     LE = 4
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ALL, __pyx_int_2) < 0) __PYX_ERR(5, 30, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":31
 *     REQ = 1
 *     ALL = 2
 *     LT = 3             # <<<<<<<<<<<<<<
 *     LE = 4
 *     GE = 5
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LT, __pyx_int_3) < 0) __PYX_ERR(5, 31, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":32
 *     ALL = 2
 *     LT = 3
 *     LE = 4             # <<<<<<<<<<<<<<
 *     GE = 5
 *     GT = 6
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LE, __pyx_int_4) < 0) __PYX_ERR(5, 32, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":33
 *     LT = 3
 *     LE = 4
 *     GE = 5             # <<<<<<<<<<<<<<
 *     GT = 6
 *     BITS_ALL_SET = 7
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GE, __pyx_int_5) < 0) __PYX_ERR(5, 33, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":34
 *     LE = 4
 *     GE = 5
 *     GT = 6             # <<<<<<<<<<<<<<
 *     BITS_ALL_SET = 7
 *     BITS_ANY_SET = 8
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GT, __pyx_int_6) < 0) __PYX_ERR(5, 34, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":35
 *     GE = 5
 *     GT = 6
 *     BITS_ALL_SET = 7             # <<<<<<<<<<<<<<
 *     BITS_ANY_SET = 8
 *     BITS_ALL_NOT_SET = 9
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BITS_ALL_SET, __pyx_int_7) < 0) __PYX_ERR(5, 35, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":36
 *     GT = 6
 *     BITS_ALL_SET = 7
 *     BITS_ANY_SET = 8             # <<<<<<<<<<<<<<
 *     BITS_ALL_NOT_SET = 9
 *     OVERLAPS = 10
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BITS_ANY_SET, __pyx_int_8) < 0) __PYX_ERR(5, 36, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":37
 *     BITS_ALL_SET = 7
 *     BITS_ANY_SET = 8
 *     BITS_ALL_NOT_SET = 9             # <<<<<<<<<<<<<<
 *     OVERLAPS = 10
 *     NEIGHBOR = 11
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BITS_ALL_NOT_SET, __pyx_int_9) < 0) __PYX_ERR(5, 37, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":38
 *     BITS_ANY_SET = 8
 *     BITS_ALL_NOT_SET = 9
 *     OVERLAPS = 10             # <<<<<<<<<<<<<<
 *     NEIGHBOR = 11
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_OVERLAPS, __pyx_int_10) < 0) __PYX_ERR(5, 38, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":39
 *     BITS_ALL_NOT_SET = 9
 *     OVERLAPS = 10
 *     NEIGHBOR = 11             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NEIGHBOR, __pyx_int_11) < 0) __PYX_ERR(5, 39, __pyx_L1_error)

  /* "asynctnt/iproto/protocol.pyx":24
 * 
 * 
 * class Iterator(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     """
 *         Available Iterator types
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Iterator, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Iterator, __pyx_t_4) < 0) __PYX_ERR(5, 24, __pyx_L1_error)
  __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":407
 * 
 * 
 * class Protocol(BaseProtocol, asyncio.Protocol):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Protocol); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_BaseProtocol));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_BaseProtocol));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_8asynctnt_6iproto_8protocol_BaseProtocol));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Protocol, __pyx_n_s_Protocol, (PyObject *) NULL, __pyx_n_s_asynctnt_iproto_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Protocol, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Protocol, __pyx_t_4) < 0) __PYX_ERR(5, 407, __pyx_L1_error)
  __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":411
 * 
 * 
 * TarantoolTuple = <object> tupleobj.AtntTuple_InitTypes()             # <<<<<<<<<<<<<<
 */
  __pyx_t_5 = AtntTuple_InitTypes(); if (unlikely(__pyx_t_5 == ((PyTypeObject *)NULL))) __PYX_ERR(5, 411, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_t_5);
  __Pyx_INCREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TarantoolTuple, __pyx_t_2) < 0) __PYX_ERR(5, 411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Request(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8asynctnt_6iproto_8protocol_1__pyx_unpickle_Request, NULL, __pyx_n_s_asynctnt_iproto_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Request, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_Request__set_state(<Request> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Request__set_state(Request __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.op = __pyx_state[0]; __pyx_result.parse_as_tuples = __pyx_state[1]; __pyx_result.parse_metadata = __pyx_state[2]; __pyx_result.push_subscribe = __pyx_state[3]; __pyx_result.response = __pyx_state[4]; __pyx_result.schema_id = __pyx_state[5]; __pyx_result.space = __pyx_state[6]; __pyx_result.sync = __pyx_state[7]; __pyx_result.timeout_handle = __pyx_state[8]; __pyx_result.waiter = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8asynctnt_6iproto_8protocol_3__pyx_unpickle_PushIterator, NULL, __pyx_n_s_asynctnt_iproto_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_PushIterator, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8asynctnt_6iproto_8protocol_5__pyx_unpickle_CoreProtocol, NULL, __pyx_n_s_asynctnt_iproto_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CoreProtocol, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.con_state = __pyx_state[0]; __pyx_result.encoding = __pyx_state[1]; __pyx_result.host = __pyx_state[2]; __pyx_result.port = __pyx_state[3]; __pyx_result.rbuf = __pyx_state[4]; __pyx_result.salt = __pyx_state[5]; __pyx_result.state = __pyx_state[6]; __pyx_result.version = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8asynctnt_6iproto_8protocol_7__pyx_unpickle_BaseProtocol, NULL, __pyx_n_s_asynctnt_iproto_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BaseProtocol, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/protocol.pyx":1
 * # cython: language_level=3             # <<<<<<<<<<<<<<
 * 
 * cimport cpython.dict
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_PushIterator___init___line_8, __pyx_kp_u_Creates_PushIterator_object_In) < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asynctnt/iproto/request.pxd":22
 *                             SchemaSpace space, bint push_subscribe)
 * 
 *     cdef inline TntFields fields(self):             # <<<<<<<<<<<<<<
 *         if self.space is None:
 *             return None
 */

  /*--- 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);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init asynctnt.iproto.protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init asynctnt.iproto.protocol");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
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);
}
#endif

/* GetBuiltinName */
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;
}

/* RaiseArgTupleInvalid */
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);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
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
    return 0;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#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

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#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

/* PyObjectCallOneArg */
#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) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    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

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    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_PyThreadState_assign
    __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 (cause) {
        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 = __Pyx_PyThreadState_Current;
        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

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* RaiseDoubleKeywords */
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
}

/* ParseKeywords */
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_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
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(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
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(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;
}

/* GetItemInt */
static 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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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))
                        return NULL;
                    PyErr_Clear();
                }
            }
            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));
}

/* DictGetItem */
#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()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_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
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#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

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
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");
}

/* RaiseTooManyValuesToUnpack */
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);
}

/* UnpackItemEndCheck */
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;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
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);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#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);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    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);
    *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;
}

/* dict_iter */
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 (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#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;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* UnicodeAsUCS4 */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
   Py_ssize_t length;
   #if CYTHON_PEP393_ENABLED
   length = PyUnicode_GET_LENGTH(x);
   if (likely(length == 1)) {
       return PyUnicode_READ_CHAR(x, 0);
   }
   #else
   length = PyUnicode_GET_SIZE(x);
   if (likely(length == 1)) {
       return PyUnicode_AS_UNICODE(x)[0];
   }
   #if Py_UNICODE_SIZE == 2
   else if (PyUnicode_GET_SIZE(x) == 2) {
       Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
       if (high_val >= 0xD800 && high_val <= 0xDBFF) {
           Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
           if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
               return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
           }
       }
   }
   #endif
   #endif
   PyErr_Format(PyExc_ValueError,
                "only single character unicode strings can be converted to Py_UCS4, "
                "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
   return (Py_UCS4)-1;
}

/* object_ord */
static long __Pyx__PyObject_Ord(PyObject* c) {
    Py_ssize_t size;
    if (PyBytes_Check(c)) {
        size = PyBytes_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyBytes_AS_STRING(c)[0];
        }
#if PY_MAJOR_VERSION < 3
    } else if (PyUnicode_Check(c)) {
        return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    } else if (PyByteArray_Check(c)) {
        size = PyByteArray_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyByteArray_AS_STRING(c)[0];
        }
#endif
    } else {
        PyErr_Format(PyExc_TypeError,
            "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
        return (long)(Py_UCS4)-1;
    }
    PyErr_Format(PyExc_TypeError,
        "ord() expected a character, but string of length %zd found", size);
    return (long)(Py_UCS4)-1;
}

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#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);
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* SliceObject */
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_USE_TYPE_SLOTS
    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))
                    goto bad;
                PyErr_Clear();
            }
        }
        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_USE_TYPE_SLOTS
        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;
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    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;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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_FAST_THREAD_STATE
    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_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    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;
    #endif
    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;
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long 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
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) 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));
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* StopAsyncIteration */
#if PY_VERSION_HEX < 0x030500B1
static PyTypeObject __Pyx__PyExc_StopAsyncIteration_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "StopAsyncIteration",
    sizeof(PyBaseExceptionObject),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
    PyDoc_STR("Signal the end from iterator.__anext__()."),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
#endif
static int __pyx_StopAsyncIteration_init(void) {
#if PY_VERSION_HEX >= 0x030500B1
    __Pyx_PyExc_StopAsyncIteration = PyExc_StopAsyncIteration;
#else
    PyObject *builtins = PyEval_GetBuiltins();
    if (likely(builtins)) {
        PyObject *exc = PyMapping_GetItemString(builtins, (char*) "StopAsyncIteration");
        if (exc) {
            __Pyx_PyExc_StopAsyncIteration = exc;
            return 0;
        }
    }
    PyErr_Clear();
    __Pyx__PyExc_StopAsyncIteration_type.tp_traverse = ((PyTypeObject*)PyExc_BaseException)->tp_traverse;
    __Pyx__PyExc_StopAsyncIteration_type.tp_clear = ((PyTypeObject*)PyExc_BaseException)->tp_clear;
    __Pyx__PyExc_StopAsyncIteration_type.tp_dictoffset = ((PyTypeObject*)PyExc_BaseException)->tp_dictoffset;
    __Pyx__PyExc_StopAsyncIteration_type.tp_base = (PyTypeObject*)PyExc_Exception;
    __Pyx_PyExc_StopAsyncIteration = (PyObject*) __Pyx_FetchCommonType(&__Pyx__PyExc_StopAsyncIteration_type);
    if (unlikely(!__Pyx_PyExc_StopAsyncIteration))
        return -1;
    if (builtins && unlikely(PyMapping_SetItemString(builtins, (char*) "StopAsyncIteration", __Pyx_PyExc_StopAsyncIteration) < 0))
        return -1;
#endif
    return 0;
}

/* ReturnWithStopIteration */
static void __Pyx__ReturnWithStopIteration(PyObject* value) {
    PyObject *exc, *args;
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_PYSTON
    __Pyx_PyThreadState_declare
    if ((PY_VERSION_HEX >= 0x03030000 && PY_VERSION_HEX < 0x030500B1)
            || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        args = PyTuple_New(1);
        if (unlikely(!args)) return;
        Py_INCREF(value);
        PyTuple_SET_ITEM(args, 0, value);
        exc = PyType_Type.tp_call(PyExc_StopIteration, args, NULL);
        Py_DECREF(args);
        if (!exc) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_type)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(PyExc_StopIteration);
        __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL);
        return;
    }
    #endif
#else
    args = PyTuple_Pack(1, value);
    if (unlikely(!args)) return;
    exc = PyObject_Call(PyExc_StopIteration, args, NULL);
    Py_DECREF(args);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(PyExc_StopIteration, exc);
    Py_DECREF(exc);
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    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;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Coroutine */
static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
    PyObject_GC_UnTrack(self);
    Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine);
    PyObject_GC_Del(self);
}
static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) {
    Py_VISIT(self->coroutine);
    return 0;
}
static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) {
    Py_CLEAR(self->coroutine);
    return 0;
}
static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) {
    return __Pyx_Generator_Next(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) {
    return __Pyx_Coroutine_Send(self->coroutine, value);
}
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) {
    return __Pyx_Coroutine_Throw(self->coroutine, args);
}
static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
    Py_INCREF(self);
    return self;
}
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_CoroutineAwait_no_new(CYTHON_UNUSED PyTypeObject *type, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwargs) {
    PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead");
    return NULL;
}
#endif
static PyMethodDef __pyx_CoroutineAwait_methods[] = {
    {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_CoroutineAwait_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_CoroutineAwaitType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "coroutine_wrapper",
    sizeof(__pyx_CoroutineAwaitObject),
    0,
    (destructor) __Pyx_CoroutineAwait_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    PyDoc_STR("A wrapper object implementing __await__ for coroutines."),
    (traverseproc) __Pyx_CoroutineAwait_traverse,
    (inquiry) __Pyx_CoroutineAwait_clear,
    0,
    0,
    __Pyx_CoroutineAwait_self,
    (iternextfunc) __Pyx_CoroutineAwait_Next,
    __pyx_CoroutineAwait_methods,
    0                         ,
    0                      ,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if !CYTHON_COMPILING_IN_PYPY
    __Pyx_CoroutineAwait_no_new,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
#if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
    __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_CoroutineAwaitType);
    if (unlikely(!await)) return NULL;
    Py_INCREF(coroutine);
    await->coroutine = coroutine;
    PyObject_GC_Track(await);
    return (PyObject*)await;
}
#endif
#if PY_VERSION_HEX < 0x030500B1
static PyObject *__Pyx_Coroutine_await_method(PyObject *coroutine, CYTHON_UNUSED PyObject *arg) {
    return __Pyx__Coroutine_await(coroutine);
}
#endif
#if defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) {
    if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) {
        PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine");
        return NULL;
    }
    return __Pyx__Coroutine_await(coroutine);
}
#endif
static PyObject *
__Pyx_Coroutine_get_frame(CYTHON_UNUSED __pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    Py_RETURN_NONE;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) {
    PyObject* result;
    switch (op) {
        case Py_EQ: result = (other == obj) ? Py_True : Py_False; break;
        case Py_NE: result = (other != obj) ? Py_True : Py_False; break;
        default:
            result = Py_NotImplemented;
    }
    Py_INCREF(result);
    return result;
}
#endif
static PyMethodDef __pyx_Coroutine_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
#if PY_VERSION_HEX < 0x030500B1
    {"__await__", (PyCFunction) __Pyx_Coroutine_await_method, METH_NOARGS,
     (char*) PyDoc_STR("__await__() -> return an iterator to be used in await expression.")},
#endif
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Coroutine_memberlist[] = {
    {(char *) "cr_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being awaited, or None")},
    {(char*) "cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Coroutine_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the coroutine"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the coroutine"), 0},
    {(char *) "cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the coroutine"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_ASYNC_SLOTS
static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async = {
    __Pyx_Coroutine_await,
    0,
    0,
};
#endif
static PyTypeObject __pyx_CoroutineType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
#if CYTHON_USE_ASYNC_SLOTS
    &__pyx_Coroutine_as_async,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
    __Pyx_Coroutine_compare,
#else
    0,
#endif
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    0,
    __pyx_Coroutine_methods,
    __pyx_Coroutine_memberlist,
    __pyx_Coroutine_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Coroutine_init(void) {
    __pyx_CoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_CoroutineType = __Pyx_FetchCommonType(&__pyx_CoroutineType_type);
    if (unlikely(!__pyx_CoroutineType))
        return -1;
#ifdef __Pyx_IterableCoroutine_USED
    if (unlikely(__pyx_IterableCoroutine_init() == -1))
        return -1;
#endif
    __pyx_CoroutineAwaitType = __Pyx_FetchCommonType(&__pyx_CoroutineAwaitType_type);
    if (unlikely(!__pyx_CoroutineAwaitType))
        return -1;
    return 0;
}

/* GetAwaitIter */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(o)) {
        return __Pyx_NewRef(o);
    }
#endif
    return __Pyx__Coroutine_GetAwaitableIter(o);
}
static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) {
#if PY_VERSION_HEX >= 0x030600B3 || defined(_PyErr_FormatFromCause)
    _PyErr_FormatFromCause(
        PyExc_TypeError,
        "'async for' received an invalid object "
        "from __anext__: %.100s",
        Py_TYPE(source)->tp_name);
#elif PY_MAJOR_VERSION >= 3
    PyObject *exc, *val, *val2, *tb;
    assert(PyErr_Occurred());
    PyErr_Fetch(&exc, &val, &tb);
    PyErr_NormalizeException(&exc, &val, &tb);
    if (tb != NULL) {
        PyException_SetTraceback(val, tb);
        Py_DECREF(tb);
    }
    Py_DECREF(exc);
    assert(!PyErr_Occurred());
    PyErr_Format(
        PyExc_TypeError,
        "'async for' received an invalid object "
        "from __anext__: %.100s",
        Py_TYPE(source)->tp_name);
    PyErr_Fetch(&exc, &val2, &tb);
    PyErr_NormalizeException(&exc, &val2, &tb);
    Py_INCREF(val);
    PyException_SetCause(val2, val);
    PyException_SetContext(val2, val);
    PyErr_Restore(exc, val2, tb);
#else
    source++;
#endif
}
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
    PyObject *res;
#if CYTHON_USE_ASYNC_SLOTS
    __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj);
    if (likely(am && am->am_await)) {
        res = (*am->am_await)(obj);
    } else
#endif
#if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
    if (PyCoro_CheckExact(obj)) {
        return __Pyx_NewRef(obj);
    } else
#endif
#if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE)
    if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
        return __Pyx_NewRef(obj);
    } else
#endif
    {
        PyObject *method = NULL;
        int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_n_s_await, &method);
        if (likely(is_method)) {
            res = __Pyx_PyObject_CallOneArg(method, obj);
        } else if (likely(method)) {
            res = __Pyx_PyObject_CallNoArg(method);
        } else
            goto slot_error;
        Py_DECREF(method);
    }
    if (unlikely(!res)) {
        __Pyx_Coroutine_AwaitableIterError(obj);
        goto bad;
    }
    if (unlikely(!PyIter_Check(res))) {
        PyErr_Format(PyExc_TypeError,
                     "__await__() returned non-iterator of type '%.100s'",
                     Py_TYPE(res)->tp_name);
        Py_CLEAR(res);
    } else {
        int is_coroutine = 0;
        #ifdef __Pyx_Coroutine_USED
        is_coroutine |= __Pyx_Coroutine_Check(res);
        #endif
        #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
        is_coroutine |= PyCoro_CheckExact(res);
        #endif
        if (unlikely(is_coroutine)) {
            /* __await__ must return an *iterator*, not
               a coroutine or another awaitable (see PEP 492) */
            PyErr_SetString(PyExc_TypeError,
                            "__await__() returned a coroutine");
            Py_CLEAR(res);
        }
    }
    return res;
slot_error:
    PyErr_Format(PyExc_TypeError,
                 "object %.100s can't be used in 'await' expression",
                 Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* CoroutineYieldFrom */
static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *retval;
    PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source);
    if (unlikely(!source_gen)) {
        return NULL;
    }
    if (__Pyx_Coroutine_Check(source_gen)) {
        retval = __Pyx_Generator_Next(source_gen);
    } else {
#if CYTHON_USE_TYPE_SLOTS
        retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
#else
        retval = PyIter_Next(source_gen);
#endif
    }
    if (retval) {
        gen->yieldfrom = source_gen;
        return retval;
    }
    Py_DECREF(source_gen);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *retval;
    if (__Pyx_Coroutine_Check(source)) {
        if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
            PyErr_SetString(
                PyExc_RuntimeError,
                "coroutine is being awaited already");
            return NULL;
        }
        retval = __Pyx_Generator_Next(source);
#ifdef __Pyx_AsyncGen_USED
    } else if (__pyx_PyAsyncGenASend_CheckExact(source)) {
        retval = __Pyx_async_gen_asend_iternext(source);
#endif
    } else {
        return __Pyx__Coroutine_Yield_From_Generic(gen, source);
    }
    if (retval) {
        Py_INCREF(source);
        gen->yieldfrom = source;
    }
    return retval;
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* Import */
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_MAJOR_VERSION < 3
    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 ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
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;
}

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* PatchInspect */
static PyObject* __Pyx_patch_inspect(PyObject* module) {
#if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT)
    static int inspect_patched = 0;
    if (unlikely((!inspect_patched) && module)) {
        module = __Pyx_Coroutine_patch_module(
            module, ""
"old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n"
"if old_types is None or not isinstance(old_types, set):\n"
"    old_types = set()\n"
"    def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n"
"        def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n"
"        cy_isgenerator._cython_generator_types = cython_generator_types\n"
"        return cy_isgenerator\n"
"    _module.isgenerator = cy_wrap(_module.isgenerator)\n"
"old_types.add(_cython_generator_type)\n"
        );
        inspect_patched = 1;
    }
#else
    if ((0)) return __Pyx_Coroutine_patch_module(module, NULL);
#endif
    return module;
}

/* PatchAsyncIO */
static PyObject* __Pyx_patch_asyncio(PyObject* module) {
#if PY_VERSION_HEX < 0x030500B2 &&\
        (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\
        (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO)
    PyObject *patch_module = NULL;
    static int asyncio_patched = 0;
    if (unlikely((!asyncio_patched) && module)) {
        PyObject *package;
        package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0);
        if (package) {
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "coroutines"), ""
"try:\n"
"    coro_types = _module._COROUTINE_TYPES\n"
"except AttributeError: pass\n"
"else:\n"
"    if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n"
"    if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_generator_type,)\n"
"_module._COROUTINE_TYPES = coro_types\n"
            );
        } else {
            PyErr_Clear();
            package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0);
            if (unlikely(!package)) goto asyncio_done;
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "tasks"), ""
"if hasattr(_module, 'iscoroutine'):\n"
"    old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n"
"    if old_types is None or not isinstance(old_types, set):\n"
"        old_types = set()\n"
"        def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n"
"            def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n"
"            cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n"
"            return cy_iscoroutine\n"
"        _module.iscoroutine = cy_wrap(_module.iscoroutine)\n"
"    if _cython_coroutine_type is not None:\n"
"        old_types.add(_cython_coroutine_type)\n"
"    if _cython_generator_type is not None:\n"
"        old_types.add(_cython_generator_type)\n"
            );
        }
        Py_DECREF(package);
        if (unlikely(!patch_module)) goto ignore;
asyncio_done:
        PyErr_Clear();
        asyncio_patched = 1;
#ifdef __Pyx_Generator_USED
        {
            PyObject *inspect_module;
            if (patch_module) {
                inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect);
                Py_DECREF(patch_module);
            } else {
                inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0);
            }
            if (unlikely(!inspect_module)) goto ignore;
            inspect_module = __Pyx_patch_inspect(inspect_module);
            if (unlikely(!inspect_module)) {
                Py_DECREF(module);
                module = NULL;
            }
            Py_XDECREF(inspect_module);
        }
#else
        if ((0)) return __Pyx_patch_inspect(module);
#endif
    }
    return module;
ignore:
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL));
#endif
    return module;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
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);
}

/* AddTraceback */
#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;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    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(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type value) {
    const enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type neg_one = (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) ((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 0 - (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 1), const_zero = (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
#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;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
    const uint64_t neg_one = (uint64_t) ((uint64_t) 0 - (uint64_t) 1), const_zero = (uint64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState value) {
    const enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState neg_one = (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) ((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 0 - (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 1), const_zero = (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState value) {
    const enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState neg_one = (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) ((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 0 - (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 1), const_zero = (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (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);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (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);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) ((uint32_t) 0 - (uint32_t) 1), const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
    const int32_t neg_one = (int32_t) ((int32_t) 0 - (int32_t) 1), const_zero = (int32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__mp_type(enum mp_type value) {
    const enum mp_type neg_one = (enum mp_type) ((enum mp_type) 0 - (enum mp_type) 1), const_zero = (enum mp_type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum mp_type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum mp_type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum mp_type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum mp_type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum mp_type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum mp_type),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(PyObject *x) {
    const enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type neg_one = (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) ((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 0 - (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 1), const_zero = (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 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 (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) >= 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) (((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) >= 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) (((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, 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(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) >= 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) (((((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)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 (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) (((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)-1)*(((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) ((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) (((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)-1)*(((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) ((((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, 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(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) (((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)-1)*(((((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, 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(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) ((((((((((enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) -1;
        }
    } else {
        enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_9tarantool_iproto_type(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type");
    return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type");
    return (enum __pyx_t_8asynctnt_6iproto_9tarantool_iproto_type) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) 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 (int64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, 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(int64_t) >= 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)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 (int64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, 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(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, 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(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (int64_t) -1;
        }
    } else {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
    const uint64_t neg_one = (uint64_t) ((uint64_t) 0 - (uint64_t) 1), const_zero = (uint64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint64_t) 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 (uint64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) {
                            return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) {
                            return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, 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(uint64_t) >= 4 * PyLong_SHIFT) {
                            return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)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 (uint64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, 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(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, 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(uint64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (uint64_t) -1;
        }
    } else {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyInt_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(PyObject *x) {
    const enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState neg_one = (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) ((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 0 - (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 1), const_zero = (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 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 (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) >= 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) (((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) >= 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) (((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, 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(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) >= 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) (((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)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 (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) (((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)-1)*(((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) ((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) (((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)-1)*(((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) ((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, 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(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) (((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)-1)*(((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, 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(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) ((((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) -1;
        }
    } else {
        enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ConnectionState(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState");
    return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState");
    return (enum __pyx_t_8asynctnt_6iproto_8protocol_ConnectionState) -1;
}

/* CIntFromPy */
static CYTHON_INLINE enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(PyObject *x) {
    const enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState neg_one = (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) ((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 0 - (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 1), const_zero = (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 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 (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) >= 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) (((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) >= 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) (((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, 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(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) >= 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) (((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)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 (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) (((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)-1)*(((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) ((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) (((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)-1)*(((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) ((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, 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(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) (((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)-1)*(((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, 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(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) ((((((((((enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) -1;
        }
    } else {
        enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_8asynctnt_6iproto_8protocol_ProtocolState(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState");
    return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState");
    return (enum __pyx_t_8asynctnt_6iproto_8protocol_ProtocolState) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } 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) (-(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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#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_IntOrLong(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_IntOrLong(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;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } 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) (-(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))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#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_IntOrLong(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_IntOrLong(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;
}

/* CIntFromPy */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
    const uint32_t neg_one = (uint32_t) ((uint32_t) 0 - (uint32_t) 1), const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_t) 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 (uint32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, 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(uint32_t) >= 4 * PyLong_SHIFT) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)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 (uint32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, 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(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, 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(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (uint32_t) -1;
        }
    } else {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) 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 (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_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
#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 (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((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(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_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
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* IterableCoroutine */
static PyTypeObject __pyx_IterableCoroutineType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "iterable_coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
#if CYTHON_USE_ASYNC_SLOTS
    &__pyx_Coroutine_as_async,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
    __Pyx_Coroutine_compare,
#else
    0,
#endif
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    __Pyx_Coroutine_await,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Coroutine_methods,
    __pyx_Coroutine_memberlist,
    __pyx_Coroutine_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_IterableCoroutine_init(void) {
    __pyx_IterableCoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_IterableCoroutineType = __Pyx_FetchCommonType(&__pyx_IterableCoroutineType_type);
    if (unlikely(!__pyx_IterableCoroutineType))
        return -1;
    return 0;
}

/* CheckBinaryVersion */
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;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
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;
        if (PyObject_Hash(*t->p) == -1)
            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 const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    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
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(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
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __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)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } 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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  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(b);
  }
#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_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
