/* Generated by Cython 0.18 on Sat Feb 16 09:29:56 2013 */

#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 < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#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, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  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) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__msgpack___unpacker
#define __PYX_HAVE_API__msgpack___unpacker
#include "string.h"
#include "stdio.h"
#include "pythread.h"
#include "stdlib.h"
#include "limits.h"
#include "unpack.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#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
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "_unpacker.pyx",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_7msgpack_9_unpacker_Unpacker;
struct __pyx_opt_args_7msgpack_9_unpacker_8Unpacker__unpack;

/* "msgpack/_unpacker.pyx":300
 *             self.file_like = None
 * 
 *     cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0):             # <<<<<<<<<<<<<<
 *         cdef int ret
 *         cdef object obj
 */

#line 300 "msgpack/_unpacker.pyx"
struct __pyx_opt_args_7msgpack_9_unpacker_8Unpacker__unpack {

#line 300 "msgpack/_unpacker.pyx"
  int __pyx_n;

#line 300 "msgpack/_unpacker.pyx"
  int iter;

#line 300 "msgpack/_unpacker.pyx"
};

/* "msgpack/_unpacker.pyx":136
 * 
 * 
 * cdef class Unpacker(object):             # <<<<<<<<<<<<<<
 *     """
 *     Streaming unpacker.
 */

#line 136 "msgpack/_unpacker.pyx"
struct __pyx_obj_7msgpack_9_unpacker_Unpacker {

#line 136 "msgpack/_unpacker.pyx"
  PyObject_HEAD

#line 136 "msgpack/_unpacker.pyx"
  struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *__pyx_vtab;

#line 136 "msgpack/_unpacker.pyx"
  template_context ctx;

#line 136 "msgpack/_unpacker.pyx"
  char *buf;

#line 136 "msgpack/_unpacker.pyx"
  size_t buf_size;

#line 136 "msgpack/_unpacker.pyx"
  size_t buf_head;

#line 136 "msgpack/_unpacker.pyx"
  size_t buf_tail;

#line 136 "msgpack/_unpacker.pyx"
  PyObject *file_like;

#line 136 "msgpack/_unpacker.pyx"
  PyObject *file_like_read;

#line 136 "msgpack/_unpacker.pyx"
  Py_ssize_t read_size;

#line 136 "msgpack/_unpacker.pyx"
  PyObject *object_hook;

#line 136 "msgpack/_unpacker.pyx"
  PyObject *encoding;

#line 136 "msgpack/_unpacker.pyx"
  PyObject *unicode_errors;

#line 136 "msgpack/_unpacker.pyx"
  size_t max_buffer_size;

#line 136 "msgpack/_unpacker.pyx"
};

#line 136 "msgpack/_unpacker.pyx"


#line 136 "msgpack/_unpacker.pyx"


#line 136 "msgpack/_unpacker.pyx"


#line 136 "msgpack/_unpacker.pyx"
struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker {

#line 136 "msgpack/_unpacker.pyx"
  PyObject *(*append_buffer)(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *, void *, Py_ssize_t);

#line 136 "msgpack/_unpacker.pyx"
  PyObject *(*read_from_file)(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *);

#line 136 "msgpack/_unpacker.pyx"
  PyObject *(*_unpack)(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_7msgpack_9_unpacker_8Unpacker__unpack *__pyx_optional_args);

#line 136 "msgpack/_unpacker.pyx"
};

#line 136 "msgpack/_unpacker.pyx"
static struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *__pyx_vtabptr_7msgpack_9_unpacker_Unpacker;
#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); /*proto*/
  #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 /* CYTHON_REFNANNY */
#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)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

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

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

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

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name); /*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); /*proto*/

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

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

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static int __Pyx_check_binary_version(void);

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

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

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

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

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


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

/* 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 'libc.string' */

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

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

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

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

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

/* Module declarations from '__builtin__' */

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

/* 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 'libc.stdlib' */

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

/* Module declarations from 'msgpack._unpacker' */
static PyTypeObject *__pyx_ptype_7msgpack_9_unpacker_Unpacker = 0;
static CYTHON_INLINE PyObject *__pyx_f_7msgpack_9_unpacker_init_ctx(template_context *, PyObject *, PyObject *, PyObject *, int, char *, char *); /*proto*/
#define __Pyx_MODULE_NAME "msgpack._unpacker"
int __pyx_module_is_main_msgpack___unpacker = 0;

/* Implementation of 'msgpack._unpacker' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_pf_7msgpack_9_unpacker_unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_2unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook); /* proto */
static int __pyx_pf_7msgpack_9_unpacker_8Unpacker___cinit__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self); /* proto */
static void __pyx_pf_7msgpack_9_unpacker_8Unpacker_2__dealloc__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self); /* proto */
static int __pyx_pf_7msgpack_9_unpacker_8Unpacker_4__init__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_6feed(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_8read_bytes(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_10unpack(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_12skip(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_14read_array_header(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_16read_map_header(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_18__iter__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_20__next__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self); /* proto */
static char __pyx_k_1[] = "object_pairs_hook and object_hook are mutually exclusive.";
static char __pyx_k_3[] = "object_hook must be a callable.";
static char __pyx_k_5[] = "object_pairs_hook must be a callable.";
static char __pyx_k_7[] = "list_hook must be a callable.";
static char __pyx_k_11[] = "Unpack failed: error = %d";
static char __pyx_k_12[] = "`file_like.read` must be a callable.";
static char __pyx_k_14[] = "read_size should be less or equal to max_buffer_size";
static char __pyx_k_16[] = "Unable to allocate internal buffer.";
static char __pyx_k_20[] = "unpacker.feed() is not be able to use with `file_like`.";
static char __pyx_k_22[] = "Unable to enlarge internal buffer.";
static char __pyx_k_24[] = "No more data to unpack.";
static char __pyx_k_27[] = "msgpack.exceptions";
static char __pyx_k_30[] = "/Users/inada-n/work/msgpack-python/msgpack/_unpacker.pyx";
static char __pyx_k_31[] = "msgpack._unpacker";
static char __pyx_k__buf[] = "buf";
static char __pyx_k__ctx[] = "ctx";
static char __pyx_k__obj[] = "obj";
static char __pyx_k__off[] = "off";
static char __pyx_k__ret[] = "ret";
static char __pyx_k__cenc[] = "cenc";
static char __pyx_k__cerr[] = "cerr";
static char __pyx_k__read[] = "read";
static char __pyx_k__ascii[] = "ascii";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__packed[] = "packed";
static char __pyx_k__stream[] = "stream";
static char __pyx_k__strict[] = "strict";
static char __pyx_k__unpack[] = "unpack";
static char __pyx_k__buf_len[] = "buf_len";
static char __pyx_k__unpackb[] = "unpackb";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__encoding[] = "encoding";
static char __pyx_k__use_list[] = "use_list";
static char __pyx_k__ExtraData[] = "ExtraData";
static char __pyx_k__OutOfData[] = "OutOfData";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k__file_like[] = "file_like";
static char __pyx_k__list_hook[] = "list_hook";
static char __pyx_k__read_size[] = "read_size";
static char __pyx_k__BufferFull[] = "BufferFull";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k__MemoryError[] = "MemoryError";
static char __pyx_k__object_hook[] = "object_hook";
static char __pyx_k__write_bytes[] = "write_bytes";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__AssertionError[] = "AssertionError";
static char __pyx_k__unicode_errors[] = "unicode_errors";
static char __pyx_k__max_buffer_size[] = "max_buffer_size";
static char __pyx_k__UnpackValueError[] = "UnpackValueError";
static char __pyx_k__object_pairs_hook[] = "object_pairs_hook";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_n_s_27;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_n_s_31;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_n_s__AssertionError;
static PyObject *__pyx_n_s__BufferFull;
static PyObject *__pyx_n_s__ExtraData;
static PyObject *__pyx_n_s__MemoryError;
static PyObject *__pyx_n_s__OutOfData;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__UnpackValueError;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__ascii;
static PyObject *__pyx_n_s__buf;
static PyObject *__pyx_n_s__buf_len;
static PyObject *__pyx_n_s__cenc;
static PyObject *__pyx_n_s__cerr;
static PyObject *__pyx_n_s__ctx;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__encoding;
static PyObject *__pyx_n_s__file_like;
static PyObject *__pyx_n_s__list_hook;
static PyObject *__pyx_n_s__max_buffer_size;
static PyObject *__pyx_n_s__obj;
static PyObject *__pyx_n_s__object_hook;
static PyObject *__pyx_n_s__object_pairs_hook;
static PyObject *__pyx_n_s__off;
static PyObject *__pyx_n_s__packed;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__read_size;
static PyObject *__pyx_n_s__ret;
static PyObject *__pyx_n_s__stream;
static PyObject *__pyx_n_s__strict;
static PyObject *__pyx_n_s__unicode_errors;
static PyObject *__pyx_n_s__unpack;
static PyObject *__pyx_n_s__unpackb;
static PyObject *__pyx_n_s__use_list;
static PyObject *__pyx_n_s__write_bytes;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_25;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_codeobj_29;
static PyObject *__pyx_k_codeobj_33;

/* "msgpack/_unpacker.pyx":49
 *     object template_data(template_context* ctx)
 * 
 * cdef inline init_ctx(template_context *ctx,             # <<<<<<<<<<<<<<
 *                      object object_hook, object object_pairs_hook, object list_hook,
 *                      bint use_list, char* encoding, char* unicode_errors):
 */

#line 49 "msgpack/_unpacker.pyx"


#line 49 "msgpack/_unpacker.pyx"
static CYTHON_INLINE PyObject *__pyx_f_7msgpack_9_unpacker_init_ctx(template_context *__pyx_v_ctx, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, char *__pyx_v_encoding, char *__pyx_v_unicode_errors) {

#line 49 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 49 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("init_ctx", 0);

  /* "msgpack/_unpacker.pyx":52
 *                      object object_hook, object object_pairs_hook, object list_hook,
 *                      bint use_list, char* encoding, char* unicode_errors):
 *     template_init(ctx)             # <<<<<<<<<<<<<<
 *     ctx.user.use_list = use_list
 *     ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL
 */

#line 52 "msgpack/_unpacker.pyx"
  template_init(__pyx_v_ctx);

  /* "msgpack/_unpacker.pyx":53
 *                      bint use_list, char* encoding, char* unicode_errors):
 *     template_init(ctx)
 *     ctx.user.use_list = use_list             # <<<<<<<<<<<<<<
 *     ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL
 * 
 */

#line 53 "msgpack/_unpacker.pyx"
  __pyx_v_ctx->user.use_list = __pyx_v_use_list;

  /* "msgpack/_unpacker.pyx":54
 *     template_init(ctx)
 *     ctx.user.use_list = use_list
 *     ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL             # <<<<<<<<<<<<<<
 * 
 *     if object_hook is not None and object_pairs_hook is not None:
 */

#line 54 "msgpack/_unpacker.pyx"
  __pyx_v_ctx->user.object_hook = ((PyObject *)NULL);

#line 54 "msgpack/_unpacker.pyx"
  __pyx_v_ctx->user.list_hook = ((PyObject *)NULL);

  /* "msgpack/_unpacker.pyx":56
 *     ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL
 * 
 *     if object_hook is not None and object_pairs_hook is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")
 * 
 */

#line 56 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_object_hook != Py_None);

#line 56 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

#line 56 "msgpack/_unpacker.pyx"
    __pyx_t_2 = (__pyx_v_object_pairs_hook != Py_None);

#line 56 "msgpack/_unpacker.pyx"
    __pyx_t_3 = __pyx_t_2;

#line 56 "msgpack/_unpacker.pyx"
  } else {

#line 56 "msgpack/_unpacker.pyx"
    __pyx_t_3 = __pyx_t_1;

#line 56 "msgpack/_unpacker.pyx"
  }

#line 56 "msgpack/_unpacker.pyx"
  if (__pyx_t_3) {

    /* "msgpack/_unpacker.pyx":57
 * 
 *     if object_hook is not None and object_pairs_hook is not None:
 *         raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")             # <<<<<<<<<<<<<<
 * 
 *     if object_hook is not None:
 */

#line 57 "msgpack/_unpacker.pyx"
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 57 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_4);

#line 57 "msgpack/_unpacker.pyx"
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 57 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 57 "msgpack/_unpacker.pyx"
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 57 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 57 "msgpack/_unpacker.pyx"
  }

#line 57 "msgpack/_unpacker.pyx"
  __pyx_L3:;

  /* "msgpack/_unpacker.pyx":59
 *         raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")
 * 
 *     if object_hook is not None:             # <<<<<<<<<<<<<<
 *         if not PyCallable_Check(object_hook):
 *             raise TypeError("object_hook must be a callable.")
 */

#line 59 "msgpack/_unpacker.pyx"
  __pyx_t_3 = (__pyx_v_object_hook != Py_None);

#line 59 "msgpack/_unpacker.pyx"
  if (__pyx_t_3) {

    /* "msgpack/_unpacker.pyx":60
 * 
 *     if object_hook is not None:
 *         if not PyCallable_Check(object_hook):             # <<<<<<<<<<<<<<
 *             raise TypeError("object_hook must be a callable.")
 *         ctx.user.object_hook = <PyObject*>object_hook
 */

#line 60 "msgpack/_unpacker.pyx"
    __pyx_t_3 = (!PyCallable_Check(__pyx_v_object_hook));

#line 60 "msgpack/_unpacker.pyx"
    if (__pyx_t_3) {

      /* "msgpack/_unpacker.pyx":61
 *     if object_hook is not None:
 *         if not PyCallable_Check(object_hook):
 *             raise TypeError("object_hook must be a callable.")             # <<<<<<<<<<<<<<
 *         ctx.user.object_hook = <PyObject*>object_hook
 * 
 */

#line 61 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 61 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 61 "msgpack/_unpacker.pyx"
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 61 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 61 "msgpack/_unpacker.pyx"
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 61 "msgpack/_unpacker.pyx"
      goto __pyx_L5;

#line 61 "msgpack/_unpacker.pyx"
    }

#line 61 "msgpack/_unpacker.pyx"
    __pyx_L5:;

    /* "msgpack/_unpacker.pyx":62
 *         if not PyCallable_Check(object_hook):
 *             raise TypeError("object_hook must be a callable.")
 *         ctx.user.object_hook = <PyObject*>object_hook             # <<<<<<<<<<<<<<
 * 
 *     if object_pairs_hook is None:
 */

#line 62 "msgpack/_unpacker.pyx"
    __pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_hook);

#line 62 "msgpack/_unpacker.pyx"
    goto __pyx_L4;

#line 62 "msgpack/_unpacker.pyx"
  }

#line 62 "msgpack/_unpacker.pyx"
  __pyx_L4:;

  /* "msgpack/_unpacker.pyx":64
 *         ctx.user.object_hook = <PyObject*>object_hook
 * 
 *     if object_pairs_hook is None:             # <<<<<<<<<<<<<<
 *         ctx.user.has_pairs_hook = False
 *     else:
 */

#line 64 "msgpack/_unpacker.pyx"
  __pyx_t_3 = (__pyx_v_object_pairs_hook == Py_None);

#line 64 "msgpack/_unpacker.pyx"
  if (__pyx_t_3) {

    /* "msgpack/_unpacker.pyx":65
 * 
 *     if object_pairs_hook is None:
 *         ctx.user.has_pairs_hook = False             # <<<<<<<<<<<<<<
 *     else:
 *         if not PyCallable_Check(object_pairs_hook):
 */

#line 65 "msgpack/_unpacker.pyx"
    __pyx_v_ctx->user.has_pairs_hook = 0;

#line 65 "msgpack/_unpacker.pyx"
    goto __pyx_L6;

#line 65 "msgpack/_unpacker.pyx"
  }

#line 65 "msgpack/_unpacker.pyx"
  /*else*/ {

    /* "msgpack/_unpacker.pyx":67
 *         ctx.user.has_pairs_hook = False
 *     else:
 *         if not PyCallable_Check(object_pairs_hook):             # <<<<<<<<<<<<<<
 *             raise TypeError("object_pairs_hook must be a callable.")
 *         ctx.user.object_hook = <PyObject*>object_pairs_hook
 */

#line 67 "msgpack/_unpacker.pyx"
    __pyx_t_3 = (!PyCallable_Check(__pyx_v_object_pairs_hook));

#line 67 "msgpack/_unpacker.pyx"
    if (__pyx_t_3) {

      /* "msgpack/_unpacker.pyx":68
 *     else:
 *         if not PyCallable_Check(object_pairs_hook):
 *             raise TypeError("object_pairs_hook must be a callable.")             # <<<<<<<<<<<<<<
 *         ctx.user.object_hook = <PyObject*>object_pairs_hook
 *         ctx.user.has_pairs_hook = True
 */

#line 68 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 68 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 68 "msgpack/_unpacker.pyx"
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 68 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 68 "msgpack/_unpacker.pyx"
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 68 "msgpack/_unpacker.pyx"
      goto __pyx_L7;

#line 68 "msgpack/_unpacker.pyx"
    }

#line 68 "msgpack/_unpacker.pyx"
    __pyx_L7:;

    /* "msgpack/_unpacker.pyx":69
 *         if not PyCallable_Check(object_pairs_hook):
 *             raise TypeError("object_pairs_hook must be a callable.")
 *         ctx.user.object_hook = <PyObject*>object_pairs_hook             # <<<<<<<<<<<<<<
 *         ctx.user.has_pairs_hook = True
 * 
 */

#line 69 "msgpack/_unpacker.pyx"
    __pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_pairs_hook);

    /* "msgpack/_unpacker.pyx":70
 *             raise TypeError("object_pairs_hook must be a callable.")
 *         ctx.user.object_hook = <PyObject*>object_pairs_hook
 *         ctx.user.has_pairs_hook = True             # <<<<<<<<<<<<<<
 * 
 *     if list_hook is not None:
 */

#line 70 "msgpack/_unpacker.pyx"
    __pyx_v_ctx->user.has_pairs_hook = 1;

#line 70 "msgpack/_unpacker.pyx"
  }

#line 70 "msgpack/_unpacker.pyx"
  __pyx_L6:;

  /* "msgpack/_unpacker.pyx":72
 *         ctx.user.has_pairs_hook = True
 * 
 *     if list_hook is not None:             # <<<<<<<<<<<<<<
 *         if not PyCallable_Check(list_hook):
 *             raise TypeError("list_hook must be a callable.")
 */

#line 72 "msgpack/_unpacker.pyx"
  __pyx_t_3 = (__pyx_v_list_hook != Py_None);

#line 72 "msgpack/_unpacker.pyx"
  if (__pyx_t_3) {

    /* "msgpack/_unpacker.pyx":73
 * 
 *     if list_hook is not None:
 *         if not PyCallable_Check(list_hook):             # <<<<<<<<<<<<<<
 *             raise TypeError("list_hook must be a callable.")
 *         ctx.user.list_hook = <PyObject*>list_hook
 */

#line 73 "msgpack/_unpacker.pyx"
    __pyx_t_3 = (!PyCallable_Check(__pyx_v_list_hook));

#line 73 "msgpack/_unpacker.pyx"
    if (__pyx_t_3) {

      /* "msgpack/_unpacker.pyx":74
 *     if list_hook is not None:
 *         if not PyCallable_Check(list_hook):
 *             raise TypeError("list_hook must be a callable.")             # <<<<<<<<<<<<<<
 *         ctx.user.list_hook = <PyObject*>list_hook
 * 
 */

#line 74 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 74 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 74 "msgpack/_unpacker.pyx"
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 74 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 74 "msgpack/_unpacker.pyx"
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 74 "msgpack/_unpacker.pyx"
      goto __pyx_L9;

#line 74 "msgpack/_unpacker.pyx"
    }

#line 74 "msgpack/_unpacker.pyx"
    __pyx_L9:;

    /* "msgpack/_unpacker.pyx":75
 *         if not PyCallable_Check(list_hook):
 *             raise TypeError("list_hook must be a callable.")
 *         ctx.user.list_hook = <PyObject*>list_hook             # <<<<<<<<<<<<<<
 * 
 *     ctx.user.encoding = encoding
 */

#line 75 "msgpack/_unpacker.pyx"
    __pyx_v_ctx->user.list_hook = ((PyObject *)__pyx_v_list_hook);

#line 75 "msgpack/_unpacker.pyx"
    goto __pyx_L8;

#line 75 "msgpack/_unpacker.pyx"
  }

#line 75 "msgpack/_unpacker.pyx"
  __pyx_L8:;

  /* "msgpack/_unpacker.pyx":77
 *         ctx.user.list_hook = <PyObject*>list_hook
 * 
 *     ctx.user.encoding = encoding             # <<<<<<<<<<<<<<
 *     ctx.user.unicode_errors = unicode_errors
 * 
 */

#line 77 "msgpack/_unpacker.pyx"
  __pyx_v_ctx->user.encoding = __pyx_v_encoding;

  /* "msgpack/_unpacker.pyx":78
 * 
 *     ctx.user.encoding = encoding
 *     ctx.user.unicode_errors = unicode_errors             # <<<<<<<<<<<<<<
 * 
 * def unpackb(object packed, object object_hook=None, object list_hook=None,
 */

#line 78 "msgpack/_unpacker.pyx"
  __pyx_v_ctx->user.unicode_errors = __pyx_v_unicode_errors;

#line 78 "msgpack/_unpacker.pyx"


#line 78 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 78 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 78 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 78 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 78 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.init_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 78 "msgpack/_unpacker.pyx"
  __pyx_r = 0;

#line 78 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 78 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 78 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 78 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 78 "msgpack/_unpacker.pyx"
}

#line 78 "msgpack/_unpacker.pyx"


#line 78 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 78 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_1unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 78 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_unpackb[] = "unpackb(packed, object_hook=None, list_hook=None, int use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack packed_bytes to object. Returns an unpacked object.\n\n    Raises `ValueError` when `packed` contains extra bytes.\n    ";
static PyMethodDef __pyx_mdef_7msgpack_9_unpacker_1unpackb = 
#line 78 "msgpack/_unpacker.pyx"
{__Pyx_NAMESTR("unpackb"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_1unpackb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_unpackb)};

#line 78 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_1unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_packed = 0
#line 78 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_object_hook = 0
#line 78 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_list_hook = 0
#line 78 "msgpack/_unpacker.pyx"
;
  int __pyx_v_use_list
#line 78 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_encoding = 0
#line 78 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_unicode_errors = 0
#line 78 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_object_pairs_hook = 0
#line 78 "msgpack/_unpacker.pyx"
;

#line 78 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 78 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 78 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("unpackb (wrapper)", 0);

#line 78 "msgpack/_unpacker.pyx"
  {

#line 78 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__packed,&__pyx_n_s__object_hook,&__pyx_n_s__list_hook,&__pyx_n_s__use_list,&__pyx_n_s__encoding,&__pyx_n_s__unicode_errors,&__pyx_n_s__object_pairs_hook,0};

#line 78 "msgpack/_unpacker.pyx"
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "msgpack/_unpacker.pyx":80
 *     ctx.user.unicode_errors = unicode_errors
 * 
 * def unpackb(object packed, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *             bint use_list=1, encoding=None, unicode_errors="strict",
 *             object_pairs_hook=None,
 */

#line 80 "msgpack/_unpacker.pyx"
    values[1] = ((PyObject *)Py_None);

#line 80 "msgpack/_unpacker.pyx"
    values[2] = ((PyObject *)Py_None);

    /* "msgpack/_unpacker.pyx":81
 * 
 * def unpackb(object packed, object object_hook=None, object list_hook=None,
 *             bint use_list=1, encoding=None, unicode_errors="strict",             # <<<<<<<<<<<<<<
 *             object_pairs_hook=None,
 *             ):
 */

#line 81 "msgpack/_unpacker.pyx"
    values[4] = ((PyObject *)Py_None);

#line 81 "msgpack/_unpacker.pyx"
    values[5] = ((PyObject *)__pyx_n_s__strict);

    /* "msgpack/_unpacker.pyx":82
 * def unpackb(object packed, object object_hook=None, object list_hook=None,
 *             bint use_list=1, encoding=None, unicode_errors="strict",
 *             object_pairs_hook=None,             # <<<<<<<<<<<<<<
 *             ):
 *     """Unpack packed_bytes to object. Returns an unpacked object.
 */

#line 82 "msgpack/_unpacker.pyx"
    values[6] = ((PyObject *)Py_None);

#line 82 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 82 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 82 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 82 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  7: 
#line 82 "msgpack/_unpacker.pyx"
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: 
#line 82 "msgpack/_unpacker.pyx"
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: 
#line 82 "msgpack/_unpacker.pyx"
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: 
#line 82 "msgpack/_unpacker.pyx"
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: 
#line 82 "msgpack/_unpacker.pyx"
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: 
#line 82 "msgpack/_unpacker.pyx"
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: 
#line 82 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 82 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 82 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 82 "msgpack/_unpacker.pyx"
      }

#line 82 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 82 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 82 "msgpack/_unpacker.pyx"
        case  0:

#line 82 "msgpack/_unpacker.pyx"
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__packed)) != 0)) kw_args--;
        else 
#line 82 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 82 "msgpack/_unpacker.pyx"
        case  1:

#line 82 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 82 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__object_hook);

#line 82 "msgpack/_unpacker.pyx"
          if (value) { values[1] = value; kw_args--; }

#line 82 "msgpack/_unpacker.pyx"
        }

#line 82 "msgpack/_unpacker.pyx"
        case  2:

#line 82 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 82 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__list_hook);

#line 82 "msgpack/_unpacker.pyx"
          if (value) { values[2] = value; kw_args--; }

#line 82 "msgpack/_unpacker.pyx"
        }

#line 82 "msgpack/_unpacker.pyx"
        case  3:

#line 82 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 82 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_list);

#line 82 "msgpack/_unpacker.pyx"
          if (value) { values[3] = value; kw_args--; }

#line 82 "msgpack/_unpacker.pyx"
        }

#line 82 "msgpack/_unpacker.pyx"
        case  4:

#line 82 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 82 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoding);

#line 82 "msgpack/_unpacker.pyx"
          if (value) { values[4] = value; kw_args--; }

#line 82 "msgpack/_unpacker.pyx"
        }

#line 82 "msgpack/_unpacker.pyx"
        case  5:

#line 82 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 82 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unicode_errors);

#line 82 "msgpack/_unpacker.pyx"
          if (value) { values[5] = value; kw_args--; }

#line 82 "msgpack/_unpacker.pyx"
        }

#line 82 "msgpack/_unpacker.pyx"
        case  6:

#line 82 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 82 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__object_pairs_hook);

#line 82 "msgpack/_unpacker.pyx"
          if (value) { values[6] = value; kw_args--; }

#line 82 "msgpack/_unpacker.pyx"
        }

#line 82 "msgpack/_unpacker.pyx"
      }

#line 82 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 82 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpackb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 82 "msgpack/_unpacker.pyx"
      }

#line 82 "msgpack/_unpacker.pyx"
    } else {

#line 82 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: 
#line 82 "msgpack/_unpacker.pyx"
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: 
#line 82 "msgpack/_unpacker.pyx"
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: 
#line 82 "msgpack/_unpacker.pyx"
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: 
#line 82 "msgpack/_unpacker.pyx"
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: 
#line 82 "msgpack/_unpacker.pyx"
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: 
#line 82 "msgpack/_unpacker.pyx"
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: 
#line 82 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 82 "msgpack/_unpacker.pyx"
        break;
        default: 
#line 82 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 82 "msgpack/_unpacker.pyx"
      }

#line 82 "msgpack/_unpacker.pyx"
    }

#line 82 "msgpack/_unpacker.pyx"
    __pyx_v_packed = values[0];

#line 82 "msgpack/_unpacker.pyx"
    __pyx_v_object_hook = values[1];

#line 82 "msgpack/_unpacker.pyx"
    __pyx_v_list_hook = values[2];

#line 82 "msgpack/_unpacker.pyx"
    if (values[3]) {

#line 82 "msgpack/_unpacker.pyx"
      __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 82 "msgpack/_unpacker.pyx"
    } else {

#line 82 "msgpack/_unpacker.pyx"
      __pyx_v_use_list = ((int)1);

#line 82 "msgpack/_unpacker.pyx"
    }

#line 82 "msgpack/_unpacker.pyx"
    __pyx_v_encoding = values[4];

#line 82 "msgpack/_unpacker.pyx"
    __pyx_v_unicode_errors = values[5];

#line 82 "msgpack/_unpacker.pyx"
    __pyx_v_object_pairs_hook = values[6];

#line 82 "msgpack/_unpacker.pyx"
  }

#line 82 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 82 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("unpackb", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); 
#line 82 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 82 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 82 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 82 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 82 "msgpack/_unpacker.pyx"
  return NULL;

#line 82 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 82 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_unpackb(__pyx_self, __pyx_v_packed, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook);

#line 82 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 82 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 82 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":80
 *     ctx.user.unicode_errors = unicode_errors
 * 
 * def unpackb(object packed, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *             bint use_list=1, encoding=None, unicode_errors="strict",
 *             object_pairs_hook=None,
 */

#line 80 "msgpack/_unpacker.pyx"


#line 80 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) {
  template_context __pyx_v_ctx
#line 80 "msgpack/_unpacker.pyx"
;
  size_t __pyx_v_off
#line 80 "msgpack/_unpacker.pyx"
;
  int __pyx_v_ret
#line 80 "msgpack/_unpacker.pyx"
;
  char *__pyx_v_buf
#line 80 "msgpack/_unpacker.pyx"
;
  Py_ssize_t __pyx_v_buf_len
#line 80 "msgpack/_unpacker.pyx"
;
  char *__pyx_v_cenc
#line 80 "msgpack/_unpacker.pyx"
;
  char *__pyx_v_cerr
#line 80 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_obj = NULL
#line 80 "msgpack/_unpacker.pyx"
;

#line 80 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("unpackb", 0);

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(__pyx_v_encoding);

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(__pyx_v_unicode_errors);

  /* "msgpack/_unpacker.pyx":89
 *     """
 *     cdef template_context ctx
 *     cdef size_t off = 0             # <<<<<<<<<<<<<<
 *     cdef int ret
 * 
 */

#line 89 "msgpack/_unpacker.pyx"
  __pyx_v_off = 0;

  /* "msgpack/_unpacker.pyx":94
 *     cdef char* buf
 *     cdef Py_ssize_t buf_len
 *     cdef char* cenc = NULL             # <<<<<<<<<<<<<<
 *     cdef char* cerr = NULL
 * 
 */

#line 94 "msgpack/_unpacker.pyx"
  __pyx_v_cenc = NULL;

  /* "msgpack/_unpacker.pyx":95
 *     cdef Py_ssize_t buf_len
 *     cdef char* cenc = NULL
 *     cdef char* cerr = NULL             # <<<<<<<<<<<<<<
 * 
 *     PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len)
 */

#line 95 "msgpack/_unpacker.pyx"
  __pyx_v_cerr = NULL;

  /* "msgpack/_unpacker.pyx":97
 *     cdef char* cerr = NULL
 * 
 *     PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len)             # <<<<<<<<<<<<<<
 * 
 *     if encoding is not None:
 */

#line 97 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyObject_AsReadBuffer(__pyx_v_packed, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "msgpack/_unpacker.pyx":99
 *     PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len)
 * 
 *     if encoding is not None:             # <<<<<<<<<<<<<<
 *         if isinstance(encoding, unicode):
 *             encoding = encoding.encode('ascii')
 */

#line 99 "msgpack/_unpacker.pyx"
  __pyx_t_2 = (__pyx_v_encoding != Py_None);

#line 99 "msgpack/_unpacker.pyx"
  if (__pyx_t_2) {

    /* "msgpack/_unpacker.pyx":100
 * 
 *     if encoding is not None:
 *         if isinstance(encoding, unicode):             # <<<<<<<<<<<<<<
 *             encoding = encoding.encode('ascii')
 *         cenc = PyBytes_AsString(encoding)
 */

#line 100 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyUnicode_Check(__pyx_v_encoding); 

#line 100 "msgpack/_unpacker.pyx"
    if (__pyx_t_2) {

      /* "msgpack/_unpacker.pyx":101
 *     if encoding is not None:
 *         if isinstance(encoding, unicode):
 *             encoding = encoding.encode('ascii')             # <<<<<<<<<<<<<<
 *         cenc = PyBytes_AsString(encoding)
 * 
 */

#line 101 "msgpack/_unpacker.pyx"
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 101 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_3);

#line 101 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 101 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 101 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

#line 101 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_v_encoding);

#line 101 "msgpack/_unpacker.pyx"
      __pyx_v_encoding = __pyx_t_4;

#line 101 "msgpack/_unpacker.pyx"
      __pyx_t_4 = 0;

#line 101 "msgpack/_unpacker.pyx"
      goto __pyx_L4;

#line 101 "msgpack/_unpacker.pyx"
    }

#line 101 "msgpack/_unpacker.pyx"
    __pyx_L4:;

    /* "msgpack/_unpacker.pyx":102
 *         if isinstance(encoding, unicode):
 *             encoding = encoding.encode('ascii')
 *         cenc = PyBytes_AsString(encoding)             # <<<<<<<<<<<<<<
 * 
 *     if unicode_errors is not None:
 */

#line 102 "msgpack/_unpacker.pyx"
    __pyx_t_5 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 102 "msgpack/_unpacker.pyx"
    __pyx_v_cenc = __pyx_t_5;

#line 102 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 102 "msgpack/_unpacker.pyx"
  }

#line 102 "msgpack/_unpacker.pyx"
  __pyx_L3:;

  /* "msgpack/_unpacker.pyx":104
 *         cenc = PyBytes_AsString(encoding)
 * 
 *     if unicode_errors is not None:             # <<<<<<<<<<<<<<
 *         if isinstance(unicode_errors, unicode):
 *             unicode_errors = unicode_errors.encode('ascii')
 */

#line 104 "msgpack/_unpacker.pyx"
  __pyx_t_2 = (__pyx_v_unicode_errors != Py_None);

#line 104 "msgpack/_unpacker.pyx"
  if (__pyx_t_2) {

    /* "msgpack/_unpacker.pyx":105
 * 
 *     if unicode_errors is not None:
 *         if isinstance(unicode_errors, unicode):             # <<<<<<<<<<<<<<
 *             unicode_errors = unicode_errors.encode('ascii')
 *         cerr = PyBytes_AsString(unicode_errors)
 */

#line 105 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyUnicode_Check(__pyx_v_unicode_errors); 

#line 105 "msgpack/_unpacker.pyx"
    if (__pyx_t_2) {

      /* "msgpack/_unpacker.pyx":106
 *     if unicode_errors is not None:
 *         if isinstance(unicode_errors, unicode):
 *             unicode_errors = unicode_errors.encode('ascii')             # <<<<<<<<<<<<<<
 *         cerr = PyBytes_AsString(unicode_errors)
 * 
 */

#line 106 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_unicode_errors, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 106 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 106 "msgpack/_unpacker.pyx"
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 106 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_3);

#line 106 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 106 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_v_unicode_errors);

#line 106 "msgpack/_unpacker.pyx"
      __pyx_v_unicode_errors = __pyx_t_3;

#line 106 "msgpack/_unpacker.pyx"
      __pyx_t_3 = 0;

#line 106 "msgpack/_unpacker.pyx"
      goto __pyx_L6;

#line 106 "msgpack/_unpacker.pyx"
    }

#line 106 "msgpack/_unpacker.pyx"
    __pyx_L6:;

    /* "msgpack/_unpacker.pyx":107
 *         if isinstance(unicode_errors, unicode):
 *             unicode_errors = unicode_errors.encode('ascii')
 *         cerr = PyBytes_AsString(unicode_errors)             # <<<<<<<<<<<<<<
 * 
 *     init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
 */

#line 107 "msgpack/_unpacker.pyx"
    __pyx_t_5 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 107 "msgpack/_unpacker.pyx"
    __pyx_v_cerr = __pyx_t_5;

#line 107 "msgpack/_unpacker.pyx"
    goto __pyx_L5;

#line 107 "msgpack/_unpacker.pyx"
  }

#line 107 "msgpack/_unpacker.pyx"
  __pyx_L5:;

  /* "msgpack/_unpacker.pyx":109
 *         cerr = PyBytes_AsString(unicode_errors)
 * 
 *     init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)             # <<<<<<<<<<<<<<
 *     ret = template_construct(&ctx, buf, buf_len, &off)
 *     if ret == 1:
 */

#line 109 "msgpack/_unpacker.pyx"
  __pyx_t_3 = __pyx_f_7msgpack_9_unpacker_init_ctx((&__pyx_v_ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 109 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_3);

#line 109 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "msgpack/_unpacker.pyx":110
 * 
 *     init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
 *     ret = template_construct(&ctx, buf, buf_len, &off)             # <<<<<<<<<<<<<<
 *     if ret == 1:
 *         obj = template_data(&ctx)
 */

#line 110 "msgpack/_unpacker.pyx"
  __pyx_t_1 = template_construct((&__pyx_v_ctx), __pyx_v_buf, __pyx_v_buf_len, (&__pyx_v_off)); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 110 "msgpack/_unpacker.pyx"
  __pyx_v_ret = __pyx_t_1;

  /* "msgpack/_unpacker.pyx":111
 *     init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
 *     ret = template_construct(&ctx, buf, buf_len, &off)
 *     if ret == 1:             # <<<<<<<<<<<<<<
 *         obj = template_data(&ctx)
 *         if off < buf_len:
 */

#line 111 "msgpack/_unpacker.pyx"
  __pyx_t_2 = (__pyx_v_ret == 1);

#line 111 "msgpack/_unpacker.pyx"
  if (__pyx_t_2) {

    /* "msgpack/_unpacker.pyx":112
 *     ret = template_construct(&ctx, buf, buf_len, &off)
 *     if ret == 1:
 *         obj = template_data(&ctx)             # <<<<<<<<<<<<<<
 *         if off < buf_len:
 *             raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
 */

#line 112 "msgpack/_unpacker.pyx"
    __pyx_t_3 = template_data((&__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 112 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_3);

#line 112 "msgpack/_unpacker.pyx"
    __pyx_v_obj = __pyx_t_3;

#line 112 "msgpack/_unpacker.pyx"
    __pyx_t_3 = 0;

    /* "msgpack/_unpacker.pyx":113
 *     if ret == 1:
 *         obj = template_data(&ctx)
 *         if off < buf_len:             # <<<<<<<<<<<<<<
 *             raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
 *         return obj
 */

#line 113 "msgpack/_unpacker.pyx"
    __pyx_t_2 = (__pyx_v_off < __pyx_v_buf_len);

#line 113 "msgpack/_unpacker.pyx"
    if (__pyx_t_2) {

      /* "msgpack/_unpacker.pyx":114
 *         obj = template_data(&ctx)
 *         if off < buf_len:
 *             raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))             # <<<<<<<<<<<<<<
 *         return obj
 *     elif ret < 0:
 */

#line 114 "msgpack/_unpacker.pyx"
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ExtraData); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_3);

#line 114 "msgpack/_unpacker.pyx"
      __pyx_t_4 = ((PyObject *)PyBytes_FromStringAndSize((__pyx_v_buf + __pyx_v_off), (__pyx_v_buf_len - __pyx_v_off))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 114 "msgpack/_unpacker.pyx"
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_6);

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_INCREF(__pyx_v_obj);

#line 114 "msgpack/_unpacker.pyx"
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_obj);

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_GIVEREF(__pyx_v_obj);

#line 114 "msgpack/_unpacker.pyx"
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_GIVEREF(__pyx_t_4);

#line 114 "msgpack/_unpacker.pyx"
      __pyx_t_4 = 0;

#line 114 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 114 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 114 "msgpack/_unpacker.pyx"
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 114 "msgpack/_unpacker.pyx"
      goto __pyx_L8;

#line 114 "msgpack/_unpacker.pyx"
    }

#line 114 "msgpack/_unpacker.pyx"
    __pyx_L8:;

    /* "msgpack/_unpacker.pyx":115
 *         if off < buf_len:
 *             raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
 *         return obj             # <<<<<<<<<<<<<<
 *     elif ret < 0:
 *         raise ValueError("Unpack failed: error = %d" % (ret,))
 */

#line 115 "msgpack/_unpacker.pyx"
    __Pyx_XDECREF(__pyx_r);

#line 115 "msgpack/_unpacker.pyx"
    __Pyx_INCREF(__pyx_v_obj);

#line 115 "msgpack/_unpacker.pyx"
    __pyx_r = __pyx_v_obj;

#line 115 "msgpack/_unpacker.pyx"
    goto __pyx_L0;

#line 115 "msgpack/_unpacker.pyx"
    goto __pyx_L7;

#line 115 "msgpack/_unpacker.pyx"
  }

  /* "msgpack/_unpacker.pyx":116
 *             raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
 *         return obj
 *     elif ret < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("Unpack failed: error = %d" % (ret,))
 *     else:
 */

#line 116 "msgpack/_unpacker.pyx"
  __pyx_t_2 = (__pyx_v_ret < 0);

#line 116 "msgpack/_unpacker.pyx"
  if (__pyx_t_2) {

    /* "msgpack/_unpacker.pyx":117
 *         return obj
 *     elif ret < 0:
 *         raise ValueError("Unpack failed: error = %d" % (ret,))             # <<<<<<<<<<<<<<
 *     else:
 *         raise UnpackValueError
 */

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_4 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_4);

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_6);

#line 117 "msgpack/_unpacker.pyx"
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(__pyx_t_4);

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_4 = 0;

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_6);

#line 117 "msgpack/_unpacker.pyx"
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_4 = 0;

#line 117 "msgpack/_unpacker.pyx"
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_4);

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 117 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 117 "msgpack/_unpacker.pyx"
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 117 "msgpack/_unpacker.pyx"
    goto __pyx_L7;

#line 117 "msgpack/_unpacker.pyx"
  }

#line 117 "msgpack/_unpacker.pyx"
  /*else*/ {

    /* "msgpack/_unpacker.pyx":119
 *         raise ValueError("Unpack failed: error = %d" % (ret,))
 *     else:
 *         raise UnpackValueError             # <<<<<<<<<<<<<<
 * 
 * 
 */

#line 119 "msgpack/_unpacker.pyx"
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__UnpackValueError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 119 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_4);

#line 119 "msgpack/_unpacker.pyx"
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 119 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 119 "msgpack/_unpacker.pyx"
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 119 "msgpack/_unpacker.pyx"
  }

#line 119 "msgpack/_unpacker.pyx"
  __pyx_L7:;

#line 119 "msgpack/_unpacker.pyx"


#line 119 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 119 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 119 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_3);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_6);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 119 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 119 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_obj);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_encoding);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_unicode_errors);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 119 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 119 "msgpack/_unpacker.pyx"
}

#line 119 "msgpack/_unpacker.pyx"


#line 119 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 119 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_3unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 119 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_2unpack[] = "unpack(stream, object_hook=None, list_hook=None, int use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack an object from `stream`.\n\n    Raises `ValueError` when `stream` has extra bytes.\n    ";
static PyMethodDef __pyx_mdef_7msgpack_9_unpacker_3unpack = 
#line 119 "msgpack/_unpacker.pyx"
{__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_3unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_2unpack)};

#line 119 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_3unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stream = 0
#line 119 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_object_hook = 0
#line 119 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_list_hook = 0
#line 119 "msgpack/_unpacker.pyx"
;
  int __pyx_v_use_list
#line 119 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_encoding = 0
#line 119 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_unicode_errors = 0
#line 119 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_object_pairs_hook = 0
#line 119 "msgpack/_unpacker.pyx"
;

#line 119 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 119 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("unpack (wrapper)", 0);

#line 119 "msgpack/_unpacker.pyx"
  {

#line 119 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stream,&__pyx_n_s__object_hook,&__pyx_n_s__list_hook,&__pyx_n_s__use_list,&__pyx_n_s__encoding,&__pyx_n_s__unicode_errors,&__pyx_n_s__object_pairs_hook,0};

#line 119 "msgpack/_unpacker.pyx"
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "msgpack/_unpacker.pyx":122
 * 
 * 
 * def unpack(object stream, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *            bint use_list=1, encoding=None, unicode_errors="strict",
 *            object_pairs_hook=None,
 */

#line 122 "msgpack/_unpacker.pyx"
    values[1] = ((PyObject *)Py_None);

#line 122 "msgpack/_unpacker.pyx"
    values[2] = ((PyObject *)Py_None);

    /* "msgpack/_unpacker.pyx":123
 * 
 * def unpack(object stream, object object_hook=None, object list_hook=None,
 *            bint use_list=1, encoding=None, unicode_errors="strict",             # <<<<<<<<<<<<<<
 *            object_pairs_hook=None,
 *            ):
 */

#line 123 "msgpack/_unpacker.pyx"
    values[4] = ((PyObject *)Py_None);

#line 123 "msgpack/_unpacker.pyx"
    values[5] = ((PyObject *)__pyx_n_s__strict);

    /* "msgpack/_unpacker.pyx":124
 * def unpack(object stream, object object_hook=None, object list_hook=None,
 *            bint use_list=1, encoding=None, unicode_errors="strict",
 *            object_pairs_hook=None,             # <<<<<<<<<<<<<<
 *            ):
 *     """Unpack an object from `stream`.
 */

#line 124 "msgpack/_unpacker.pyx"
    values[6] = ((PyObject *)Py_None);

#line 124 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 124 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 124 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 124 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  7: 
#line 124 "msgpack/_unpacker.pyx"
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: 
#line 124 "msgpack/_unpacker.pyx"
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: 
#line 124 "msgpack/_unpacker.pyx"
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: 
#line 124 "msgpack/_unpacker.pyx"
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: 
#line 124 "msgpack/_unpacker.pyx"
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: 
#line 124 "msgpack/_unpacker.pyx"
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: 
#line 124 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 124 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 124 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 124 "msgpack/_unpacker.pyx"
      }

#line 124 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 124 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 124 "msgpack/_unpacker.pyx"
        case  0:

#line 124 "msgpack/_unpacker.pyx"
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream)) != 0)) kw_args--;
        else 
#line 124 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 124 "msgpack/_unpacker.pyx"
        case  1:

#line 124 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 124 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__object_hook);

#line 124 "msgpack/_unpacker.pyx"
          if (value) { values[1] = value; kw_args--; }

#line 124 "msgpack/_unpacker.pyx"
        }

#line 124 "msgpack/_unpacker.pyx"
        case  2:

#line 124 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 124 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__list_hook);

#line 124 "msgpack/_unpacker.pyx"
          if (value) { values[2] = value; kw_args--; }

#line 124 "msgpack/_unpacker.pyx"
        }

#line 124 "msgpack/_unpacker.pyx"
        case  3:

#line 124 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 124 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_list);

#line 124 "msgpack/_unpacker.pyx"
          if (value) { values[3] = value; kw_args--; }

#line 124 "msgpack/_unpacker.pyx"
        }

#line 124 "msgpack/_unpacker.pyx"
        case  4:

#line 124 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 124 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoding);

#line 124 "msgpack/_unpacker.pyx"
          if (value) { values[4] = value; kw_args--; }

#line 124 "msgpack/_unpacker.pyx"
        }

#line 124 "msgpack/_unpacker.pyx"
        case  5:

#line 124 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 124 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unicode_errors);

#line 124 "msgpack/_unpacker.pyx"
          if (value) { values[5] = value; kw_args--; }

#line 124 "msgpack/_unpacker.pyx"
        }

#line 124 "msgpack/_unpacker.pyx"
        case  6:

#line 124 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 124 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__object_pairs_hook);

#line 124 "msgpack/_unpacker.pyx"
          if (value) { values[6] = value; kw_args--; }

#line 124 "msgpack/_unpacker.pyx"
        }

#line 124 "msgpack/_unpacker.pyx"
      }

#line 124 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 124 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 124 "msgpack/_unpacker.pyx"
      }

#line 124 "msgpack/_unpacker.pyx"
    } else {

#line 124 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: 
#line 124 "msgpack/_unpacker.pyx"
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: 
#line 124 "msgpack/_unpacker.pyx"
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: 
#line 124 "msgpack/_unpacker.pyx"
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: 
#line 124 "msgpack/_unpacker.pyx"
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: 
#line 124 "msgpack/_unpacker.pyx"
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: 
#line 124 "msgpack/_unpacker.pyx"
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: 
#line 124 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 124 "msgpack/_unpacker.pyx"
        break;
        default: 
#line 124 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 124 "msgpack/_unpacker.pyx"
      }

#line 124 "msgpack/_unpacker.pyx"
    }

#line 124 "msgpack/_unpacker.pyx"
    __pyx_v_stream = values[0];

#line 124 "msgpack/_unpacker.pyx"
    __pyx_v_object_hook = values[1];

#line 124 "msgpack/_unpacker.pyx"
    __pyx_v_list_hook = values[2];

#line 124 "msgpack/_unpacker.pyx"
    if (values[3]) {

#line 124 "msgpack/_unpacker.pyx"
      __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 124 "msgpack/_unpacker.pyx"
    } else {

#line 124 "msgpack/_unpacker.pyx"
      __pyx_v_use_list = ((int)1);

#line 124 "msgpack/_unpacker.pyx"
    }

#line 124 "msgpack/_unpacker.pyx"
    __pyx_v_encoding = values[4];

#line 124 "msgpack/_unpacker.pyx"
    __pyx_v_unicode_errors = values[5];

#line 124 "msgpack/_unpacker.pyx"
    __pyx_v_object_pairs_hook = values[6];

#line 124 "msgpack/_unpacker.pyx"
  }

#line 124 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 124 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("unpack", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); 
#line 124 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 124 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 124 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 124 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 124 "msgpack/_unpacker.pyx"
  return NULL;

#line 124 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 124 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_2unpack(__pyx_self, __pyx_v_stream, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook);

#line 124 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 124 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 124 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":122
 * 
 * 
 * def unpack(object stream, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *            bint use_list=1, encoding=None, unicode_errors="strict",
 *            object_pairs_hook=None,
 */

#line 122 "msgpack/_unpacker.pyx"


#line 122 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_2unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) {

#line 122 "msgpack/_unpacker.pyx"
  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;

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("unpack", 0);

  /* "msgpack/_unpacker.pyx":130
 *     Raises `ValueError` when `stream` has extra bytes.
 *     """
 *     return unpackb(stream.read(), use_list=use_list,             # <<<<<<<<<<<<<<
 *                    object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook,
 *                    encoding=encoding, unicode_errors=unicode_errors,
 */

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__unpackb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_stream, __pyx_n_s__read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_3);

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 130 "msgpack/_unpacker.pyx"
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(__pyx_t_3);

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_3 = 0;

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

#line 130 "msgpack/_unpacker.pyx"
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_use_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_4);

#line 130 "msgpack/_unpacker.pyx"
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__use_list), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 130 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "msgpack/_unpacker.pyx":131
 *     """
 *     return unpackb(stream.read(), use_list=use_list,
 *                    object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook,             # <<<<<<<<<<<<<<
 *                    encoding=encoding, unicode_errors=unicode_errors,
 *                    )
 */

#line 131 "msgpack/_unpacker.pyx"
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__object_hook), __pyx_v_object_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 131 "msgpack/_unpacker.pyx"
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__object_pairs_hook), __pyx_v_object_pairs_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 131 "msgpack/_unpacker.pyx"
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__list_hook), __pyx_v_list_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "msgpack/_unpacker.pyx":132
 *     return unpackb(stream.read(), use_list=use_list,
 *                    object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook,
 *                    encoding=encoding, unicode_errors=unicode_errors,             # <<<<<<<<<<<<<<
 *                    )
 * 
 */

#line 132 "msgpack/_unpacker.pyx"
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoding), __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 132 "msgpack/_unpacker.pyx"
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__unicode_errors), __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 132 "msgpack/_unpacker.pyx"
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_4);

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

#line 132 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_t_4;

#line 132 "msgpack/_unpacker.pyx"
  __pyx_t_4 = 0;

#line 132 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 132 "msgpack/_unpacker.pyx"


#line 132 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 132 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 132 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_2);

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_3);

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 132 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 132 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 132 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 132 "msgpack/_unpacker.pyx"
}

#line 132 "msgpack/_unpacker.pyx"


#line 132 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 132 "msgpack/_unpacker.pyx"
static int __pyx_pw_7msgpack_9_unpacker_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 132 "msgpack/_unpacker.pyx"
static int __pyx_pw_7msgpack_9_unpacker_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {

#line 132 "msgpack/_unpacker.pyx"
  int __pyx_r;

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);

#line 132 "msgpack/_unpacker.pyx"
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;
#line 132 "msgpack/_unpacker.pyx"
}

#line 132 "msgpack/_unpacker.pyx"
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = 
#line 132 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker___cinit__(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self));

#line 132 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 132 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 132 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":193
 *     cdef size_t max_buffer_size
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 * 
 */

#line 193 "msgpack/_unpacker.pyx"


#line 193 "msgpack/_unpacker.pyx"
static int __pyx_pf_7msgpack_9_unpacker_8Unpacker___cinit__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self) {

#line 193 "msgpack/_unpacker.pyx"
  int __pyx_r;
  __Pyx_RefNannyDeclarations

#line 193 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "msgpack/_unpacker.pyx":194
 * 
 *     def __cinit__(self):
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */

#line 194 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf = NULL;

#line 194 "msgpack/_unpacker.pyx"


#line 194 "msgpack/_unpacker.pyx"
  __pyx_r = 0;

#line 194 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 194 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 194 "msgpack/_unpacker.pyx"
}

#line 194 "msgpack/_unpacker.pyx"


#line 194 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 194 "msgpack/_unpacker.pyx"
static void __pyx_pw_7msgpack_9_unpacker_8Unpacker_3__dealloc__(PyObject *__pyx_v_self); /*proto*/

#line 194 "msgpack/_unpacker.pyx"
static void __pyx_pw_7msgpack_9_unpacker_8Unpacker_3__dealloc__(PyObject *__pyx_v_self) {

#line 194 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 194 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);

#line 194 "msgpack/_unpacker.pyx"
  __pyx_pf_7msgpack_9_unpacker_8Unpacker_2__dealloc__(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self));

#line 194 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 194 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":196
 *         self.buf = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.buf)
 *         self.buf = NULL
 */

#line 196 "msgpack/_unpacker.pyx"


#line 196 "msgpack/_unpacker.pyx"
static void __pyx_pf_7msgpack_9_unpacker_8Unpacker_2__dealloc__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self) {
  __Pyx_RefNannyDeclarations

#line 196 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "msgpack/_unpacker.pyx":197
 * 
 *     def __dealloc__(self):
 *         free(self.buf)             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 * 
 */

#line 197 "msgpack/_unpacker.pyx"
  free(__pyx_v_self->buf);

  /* "msgpack/_unpacker.pyx":198
 *     def __dealloc__(self):
 *         free(self.buf)
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
 */

#line 198 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf = NULL;

#line 198 "msgpack/_unpacker.pyx"


#line 198 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 198 "msgpack/_unpacker.pyx"
}

#line 198 "msgpack/_unpacker.pyx"


#line 198 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 198 "msgpack/_unpacker.pyx"
static int __pyx_pw_7msgpack_9_unpacker_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 198 "msgpack/_unpacker.pyx"
static int __pyx_pw_7msgpack_9_unpacker_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file_like = 0
#line 198 "msgpack/_unpacker.pyx"
;
  Py_ssize_t __pyx_v_read_size
#line 198 "msgpack/_unpacker.pyx"
;
  int __pyx_v_use_list
#line 198 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_object_hook = 0
#line 198 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_object_pairs_hook = 0
#line 198 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_list_hook = 0
#line 198 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_encoding = 0
#line 198 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_unicode_errors = 0
#line 198 "msgpack/_unpacker.pyx"
;
  int __pyx_v_max_buffer_size
#line 198 "msgpack/_unpacker.pyx"
;

#line 198 "msgpack/_unpacker.pyx"
  int __pyx_r;

#line 198 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 198 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);

#line 198 "msgpack/_unpacker.pyx"
  {

#line 198 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file_like,&__pyx_n_s__read_size,&__pyx_n_s__use_list,&__pyx_n_s__object_hook,&__pyx_n_s__object_pairs_hook,&__pyx_n_s__list_hook,&__pyx_n_s__encoding,&__pyx_n_s__unicode_errors,&__pyx_n_s__max_buffer_size,0};

#line 198 "msgpack/_unpacker.pyx"
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};

    /* "msgpack/_unpacker.pyx":200
 *         self.buf = NULL
 * 
 *     def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,             # <<<<<<<<<<<<<<
 *                  object object_hook=None, object object_pairs_hook=None, object list_hook=None,
 *                  encoding=None, unicode_errors='strict', int max_buffer_size=0,
 */

#line 200 "msgpack/_unpacker.pyx"
    values[0] = ((PyObject *)Py_None);

    /* "msgpack/_unpacker.pyx":201
 * 
 *     def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
 *                  object object_hook=None, object object_pairs_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *                  encoding=None, unicode_errors='strict', int max_buffer_size=0,
 *                  ):
 */

#line 201 "msgpack/_unpacker.pyx"
    values[3] = ((PyObject *)Py_None);

#line 201 "msgpack/_unpacker.pyx"
    values[4] = ((PyObject *)Py_None);

#line 201 "msgpack/_unpacker.pyx"
    values[5] = ((PyObject *)Py_None);

    /* "msgpack/_unpacker.pyx":202
 *     def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
 *                  object object_hook=None, object object_pairs_hook=None, object list_hook=None,
 *                  encoding=None, unicode_errors='strict', int max_buffer_size=0,             # <<<<<<<<<<<<<<
 *                  ):
 *         cdef char *cenc=NULL, *cerr=NULL
 */

#line 202 "msgpack/_unpacker.pyx"
    values[6] = ((PyObject *)Py_None);

#line 202 "msgpack/_unpacker.pyx"
    values[7] = ((PyObject *)__pyx_n_s__strict);

#line 202 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 202 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 202 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 202 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  9: 
#line 202 "msgpack/_unpacker.pyx"
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: 
#line 202 "msgpack/_unpacker.pyx"
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: 
#line 202 "msgpack/_unpacker.pyx"
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: 
#line 202 "msgpack/_unpacker.pyx"
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: 
#line 202 "msgpack/_unpacker.pyx"
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: 
#line 202 "msgpack/_unpacker.pyx"
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: 
#line 202 "msgpack/_unpacker.pyx"
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: 
#line 202 "msgpack/_unpacker.pyx"
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: 
#line 202 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 202 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 202 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 202 "msgpack/_unpacker.pyx"
      }

#line 202 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 202 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 202 "msgpack/_unpacker.pyx"
        case  0:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file_like);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[0] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  1:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__read_size);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[1] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  2:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__use_list);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[2] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  3:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__object_hook);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[3] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  4:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__object_pairs_hook);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[4] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  5:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__list_hook);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[5] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  6:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoding);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[6] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  7:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unicode_errors);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[7] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
        case  8:

#line 202 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 202 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_buffer_size);

#line 202 "msgpack/_unpacker.pyx"
          if (value) { values[8] = value; kw_args--; }

#line 202 "msgpack/_unpacker.pyx"
        }

#line 202 "msgpack/_unpacker.pyx"
      }

#line 202 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 202 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 202 "msgpack/_unpacker.pyx"
      }

#line 202 "msgpack/_unpacker.pyx"
    } else {

#line 202 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: 
#line 202 "msgpack/_unpacker.pyx"
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: 
#line 202 "msgpack/_unpacker.pyx"
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: 
#line 202 "msgpack/_unpacker.pyx"
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: 
#line 202 "msgpack/_unpacker.pyx"
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: 
#line 202 "msgpack/_unpacker.pyx"
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: 
#line 202 "msgpack/_unpacker.pyx"
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: 
#line 202 "msgpack/_unpacker.pyx"
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: 
#line 202 "msgpack/_unpacker.pyx"
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: 
#line 202 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: 
#line 202 "msgpack/_unpacker.pyx"
break;
        default: 
#line 202 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 202 "msgpack/_unpacker.pyx"
      }

#line 202 "msgpack/_unpacker.pyx"
    }

#line 202 "msgpack/_unpacker.pyx"
    __pyx_v_file_like = values[0];

#line 202 "msgpack/_unpacker.pyx"
    if (values[1]) {

#line 202 "msgpack/_unpacker.pyx"
      __pyx_v_read_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_read_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 202 "msgpack/_unpacker.pyx"
    } else {

#line 202 "msgpack/_unpacker.pyx"
      __pyx_v_read_size = ((Py_ssize_t)0);

#line 202 "msgpack/_unpacker.pyx"
    }

#line 202 "msgpack/_unpacker.pyx"
    if (values[2]) {

#line 202 "msgpack/_unpacker.pyx"
      __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 202 "msgpack/_unpacker.pyx"
    } else {

#line 202 "msgpack/_unpacker.pyx"
      __pyx_v_use_list = ((int)1);

#line 202 "msgpack/_unpacker.pyx"
    }

#line 202 "msgpack/_unpacker.pyx"
    __pyx_v_object_hook = values[3];

#line 202 "msgpack/_unpacker.pyx"
    __pyx_v_object_pairs_hook = values[4];

#line 202 "msgpack/_unpacker.pyx"
    __pyx_v_list_hook = values[5];

#line 202 "msgpack/_unpacker.pyx"
    __pyx_v_encoding = values[6];

#line 202 "msgpack/_unpacker.pyx"
    __pyx_v_unicode_errors = values[7];

#line 202 "msgpack/_unpacker.pyx"
    if (values[8]) {

#line 202 "msgpack/_unpacker.pyx"
      __pyx_v_max_buffer_size = __Pyx_PyInt_AsInt(values[8]); if (unlikely((__pyx_v_max_buffer_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 202 "msgpack/_unpacker.pyx"
    } else {

#line 202 "msgpack/_unpacker.pyx"
      __pyx_v_max_buffer_size = ((int)0);

#line 202 "msgpack/_unpacker.pyx"
    }

#line 202 "msgpack/_unpacker.pyx"
  }

#line 202 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 202 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); 
#line 202 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 202 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 202 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 202 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 202 "msgpack/_unpacker.pyx"
  return -1;

#line 202 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 202 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_4__init__(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), __pyx_v_file_like, __pyx_v_read_size, __pyx_v_use_list, __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_max_buffer_size);

#line 202 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 202 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 202 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":200
 *         self.buf = NULL
 * 
 *     def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,             # <<<<<<<<<<<<<<
 *                  object object_hook=None, object object_pairs_hook=None, object list_hook=None,
 *                  encoding=None, unicode_errors='strict', int max_buffer_size=0,
 */

#line 200 "msgpack/_unpacker.pyx"


#line 200 "msgpack/_unpacker.pyx"
static int __pyx_pf_7msgpack_9_unpacker_8Unpacker_4__init__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size) {
  char *__pyx_v_cenc
#line 200 "msgpack/_unpacker.pyx"
;
  char *__pyx_v_cerr
#line 200 "msgpack/_unpacker.pyx"
;

#line 200 "msgpack/_unpacker.pyx"
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 200 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__init__", 0);

#line 200 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(__pyx_v_encoding);

#line 200 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(__pyx_v_unicode_errors);

  /* "msgpack/_unpacker.pyx":204
 *                  encoding=None, unicode_errors='strict', int max_buffer_size=0,
 *                  ):
 *         cdef char *cenc=NULL, *cerr=NULL             # <<<<<<<<<<<<<<
 * 
 *         self.file_like = file_like
 */

#line 204 "msgpack/_unpacker.pyx"
  __pyx_v_cenc = NULL;

#line 204 "msgpack/_unpacker.pyx"
  __pyx_v_cerr = NULL;

  /* "msgpack/_unpacker.pyx":206
 *         cdef char *cenc=NULL, *cerr=NULL
 * 
 *         self.file_like = file_like             # <<<<<<<<<<<<<<
 *         if file_like:
 *             self.file_like_read = file_like.read
 */

#line 206 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(__pyx_v_file_like);

#line 206 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(__pyx_v_file_like);

#line 206 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_v_self->file_like);

#line 206 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_v_self->file_like);

#line 206 "msgpack/_unpacker.pyx"
  __pyx_v_self->file_like = __pyx_v_file_like;

  /* "msgpack/_unpacker.pyx":207
 * 
 *         self.file_like = file_like
 *         if file_like:             # <<<<<<<<<<<<<<
 *             self.file_like_read = file_like.read
 *             if not PyCallable_Check(self.file_like_read):
 */

#line 207 "msgpack/_unpacker.pyx"
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_file_like); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 207 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":208
 *         self.file_like = file_like
 *         if file_like:
 *             self.file_like_read = file_like.read             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(self.file_like_read):
 *                 raise ValueError("`file_like.read` must be a callable.")
 */

#line 208 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_file_like, __pyx_n_s__read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 208 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_2);

#line 208 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(__pyx_t_2);

#line 208 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_v_self->file_like_read);

#line 208 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_v_self->file_like_read);

#line 208 "msgpack/_unpacker.pyx"
    __pyx_v_self->file_like_read = __pyx_t_2;

#line 208 "msgpack/_unpacker.pyx"
    __pyx_t_2 = 0;

    /* "msgpack/_unpacker.pyx":209
 *         if file_like:
 *             self.file_like_read = file_like.read
 *             if not PyCallable_Check(self.file_like_read):             # <<<<<<<<<<<<<<
 *                 raise ValueError("`file_like.read` must be a callable.")
 *         if not max_buffer_size:
 */

#line 209 "msgpack/_unpacker.pyx"
    __pyx_t_2 = __pyx_v_self->file_like_read;

#line 209 "msgpack/_unpacker.pyx"
    __Pyx_INCREF(__pyx_t_2);

#line 209 "msgpack/_unpacker.pyx"
    __pyx_t_1 = (!PyCallable_Check(__pyx_t_2));

#line 209 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 209 "msgpack/_unpacker.pyx"
    if (__pyx_t_1) {

      /* "msgpack/_unpacker.pyx":210
 *             self.file_like_read = file_like.read
 *             if not PyCallable_Check(self.file_like_read):
 *                 raise ValueError("`file_like.read` must be a callable.")             # <<<<<<<<<<<<<<
 *         if not max_buffer_size:
 *             max_buffer_size = INT_MAX
 */

#line 210 "msgpack/_unpacker.pyx"
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 210 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_2);

#line 210 "msgpack/_unpacker.pyx"
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);

#line 210 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 210 "msgpack/_unpacker.pyx"
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 210 "msgpack/_unpacker.pyx"
      goto __pyx_L4;

#line 210 "msgpack/_unpacker.pyx"
    }

#line 210 "msgpack/_unpacker.pyx"
    __pyx_L4:;

#line 210 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 210 "msgpack/_unpacker.pyx"
  }

#line 210 "msgpack/_unpacker.pyx"
  __pyx_L3:;

  /* "msgpack/_unpacker.pyx":211
 *             if not PyCallable_Check(self.file_like_read):
 *                 raise ValueError("`file_like.read` must be a callable.")
 *         if not max_buffer_size:             # <<<<<<<<<<<<<<
 *             max_buffer_size = INT_MAX
 *         if read_size > max_buffer_size:
 */

#line 211 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (!__pyx_v_max_buffer_size);

#line 211 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":212
 *                 raise ValueError("`file_like.read` must be a callable.")
 *         if not max_buffer_size:
 *             max_buffer_size = INT_MAX             # <<<<<<<<<<<<<<
 *         if read_size > max_buffer_size:
 *             raise ValueError("read_size should be less or equal to max_buffer_size")
 */

#line 212 "msgpack/_unpacker.pyx"
    __pyx_v_max_buffer_size = INT_MAX;

#line 212 "msgpack/_unpacker.pyx"
    goto __pyx_L5;

#line 212 "msgpack/_unpacker.pyx"
  }

#line 212 "msgpack/_unpacker.pyx"
  __pyx_L5:;

  /* "msgpack/_unpacker.pyx":213
 *         if not max_buffer_size:
 *             max_buffer_size = INT_MAX
 *         if read_size > max_buffer_size:             # <<<<<<<<<<<<<<
 *             raise ValueError("read_size should be less or equal to max_buffer_size")
 *         if not read_size:
 */

#line 213 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_read_size > __pyx_v_max_buffer_size);

#line 213 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":214
 *             max_buffer_size = INT_MAX
 *         if read_size > max_buffer_size:
 *             raise ValueError("read_size should be less or equal to max_buffer_size")             # <<<<<<<<<<<<<<
 *         if not read_size:
 *             read_size = min(max_buffer_size, 1024**2)
 */

#line 214 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 214 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_2);

#line 214 "msgpack/_unpacker.pyx"
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);

#line 214 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 214 "msgpack/_unpacker.pyx"
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 214 "msgpack/_unpacker.pyx"
    goto __pyx_L6;

#line 214 "msgpack/_unpacker.pyx"
  }

#line 214 "msgpack/_unpacker.pyx"
  __pyx_L6:;

  /* "msgpack/_unpacker.pyx":215
 *         if read_size > max_buffer_size:
 *             raise ValueError("read_size should be less or equal to max_buffer_size")
 *         if not read_size:             # <<<<<<<<<<<<<<
 *             read_size = min(max_buffer_size, 1024**2)
 *         self.max_buffer_size = max_buffer_size
 */

#line 215 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (!__pyx_v_read_size);

#line 215 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":216
 *             raise ValueError("read_size should be less or equal to max_buffer_size")
 *         if not read_size:
 *             read_size = min(max_buffer_size, 1024**2)             # <<<<<<<<<<<<<<
 *         self.max_buffer_size = max_buffer_size
 *         self.read_size = read_size
 */

#line 216 "msgpack/_unpacker.pyx"
    __pyx_t_3 = 1048576;

#line 216 "msgpack/_unpacker.pyx"
    __pyx_t_4 = __pyx_v_max_buffer_size;

#line 216 "msgpack/_unpacker.pyx"
    if ((__pyx_t_3 < __pyx_t_4)) {

#line 216 "msgpack/_unpacker.pyx"
      __pyx_t_5 = __pyx_t_3;

#line 216 "msgpack/_unpacker.pyx"
    } else {

#line 216 "msgpack/_unpacker.pyx"
      __pyx_t_5 = __pyx_t_4;

#line 216 "msgpack/_unpacker.pyx"
    }

#line 216 "msgpack/_unpacker.pyx"
    __pyx_v_read_size = __pyx_t_5;

#line 216 "msgpack/_unpacker.pyx"
    goto __pyx_L7;

#line 216 "msgpack/_unpacker.pyx"
  }

#line 216 "msgpack/_unpacker.pyx"
  __pyx_L7:;

  /* "msgpack/_unpacker.pyx":217
 *         if not read_size:
 *             read_size = min(max_buffer_size, 1024**2)
 *         self.max_buffer_size = max_buffer_size             # <<<<<<<<<<<<<<
 *         self.read_size = read_size
 *         self.buf = <char*>malloc(read_size)
 */

#line 217 "msgpack/_unpacker.pyx"
  __pyx_v_self->max_buffer_size = __pyx_v_max_buffer_size;

  /* "msgpack/_unpacker.pyx":218
 *             read_size = min(max_buffer_size, 1024**2)
 *         self.max_buffer_size = max_buffer_size
 *         self.read_size = read_size             # <<<<<<<<<<<<<<
 *         self.buf = <char*>malloc(read_size)
 *         if self.buf == NULL:
 */

#line 218 "msgpack/_unpacker.pyx"
  __pyx_v_self->read_size = __pyx_v_read_size;

  /* "msgpack/_unpacker.pyx":219
 *         self.max_buffer_size = max_buffer_size
 *         self.read_size = read_size
 *         self.buf = <char*>malloc(read_size)             # <<<<<<<<<<<<<<
 *         if self.buf == NULL:
 *             raise MemoryError("Unable to allocate internal buffer.")
 */

#line 219 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf = ((char *)malloc(__pyx_v_read_size));

  /* "msgpack/_unpacker.pyx":220
 *         self.read_size = read_size
 *         self.buf = <char*>malloc(read_size)
 *         if self.buf == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Unable to allocate internal buffer.")
 *         self.buf_size = read_size
 */

#line 220 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_self->buf == NULL);

#line 220 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":221
 *         self.buf = <char*>malloc(read_size)
 *         if self.buf == NULL:
 *             raise MemoryError("Unable to allocate internal buffer.")             # <<<<<<<<<<<<<<
 *         self.buf_size = read_size
 *         self.buf_head = 0
 */

#line 221 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 221 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_2);

#line 221 "msgpack/_unpacker.pyx"
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);

#line 221 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 221 "msgpack/_unpacker.pyx"
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 221 "msgpack/_unpacker.pyx"
    goto __pyx_L8;

#line 221 "msgpack/_unpacker.pyx"
  }

#line 221 "msgpack/_unpacker.pyx"
  __pyx_L8:;

  /* "msgpack/_unpacker.pyx":222
 *         if self.buf == NULL:
 *             raise MemoryError("Unable to allocate internal buffer.")
 *         self.buf_size = read_size             # <<<<<<<<<<<<<<
 *         self.buf_head = 0
 *         self.buf_tail = 0
 */

#line 222 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_size = __pyx_v_read_size;

  /* "msgpack/_unpacker.pyx":223
 *             raise MemoryError("Unable to allocate internal buffer.")
 *         self.buf_size = read_size
 *         self.buf_head = 0             # <<<<<<<<<<<<<<
 *         self.buf_tail = 0
 * 
 */

#line 223 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_head = 0;

  /* "msgpack/_unpacker.pyx":224
 *         self.buf_size = read_size
 *         self.buf_head = 0
 *         self.buf_tail = 0             # <<<<<<<<<<<<<<
 * 
 *         if encoding is not None:
 */

#line 224 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_tail = 0;

  /* "msgpack/_unpacker.pyx":226
 *         self.buf_tail = 0
 * 
 *         if encoding is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(encoding, unicode):
 *                 encoding = encoding.encode('ascii')
 */

#line 226 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_encoding != Py_None);

#line 226 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":227
 * 
 *         if encoding is not None:
 *             if isinstance(encoding, unicode):             # <<<<<<<<<<<<<<
 *                 encoding = encoding.encode('ascii')
 *             self.encoding = encoding
 */

#line 227 "msgpack/_unpacker.pyx"
    __pyx_t_1 = PyUnicode_Check(__pyx_v_encoding); 

#line 227 "msgpack/_unpacker.pyx"
    if (__pyx_t_1) {

      /* "msgpack/_unpacker.pyx":228
 *         if encoding is not None:
 *             if isinstance(encoding, unicode):
 *                 encoding = encoding.encode('ascii')             # <<<<<<<<<<<<<<
 *             self.encoding = encoding
 *             cenc = PyBytes_AsString(encoding)
 */

#line 228 "msgpack/_unpacker.pyx"
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 228 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_2);

#line 228 "msgpack/_unpacker.pyx"
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 228 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_6);

#line 228 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 228 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_v_encoding);

#line 228 "msgpack/_unpacker.pyx"
      __pyx_v_encoding = __pyx_t_6;

#line 228 "msgpack/_unpacker.pyx"
      __pyx_t_6 = 0;

#line 228 "msgpack/_unpacker.pyx"
      goto __pyx_L10;

#line 228 "msgpack/_unpacker.pyx"
    }

#line 228 "msgpack/_unpacker.pyx"
    __pyx_L10:;

    /* "msgpack/_unpacker.pyx":229
 *             if isinstance(encoding, unicode):
 *                 encoding = encoding.encode('ascii')
 *             self.encoding = encoding             # <<<<<<<<<<<<<<
 *             cenc = PyBytes_AsString(encoding)
 * 
 */

#line 229 "msgpack/_unpacker.pyx"
    __Pyx_INCREF(__pyx_v_encoding);

#line 229 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(__pyx_v_encoding);

#line 229 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_v_self->encoding);

#line 229 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_v_self->encoding);

#line 229 "msgpack/_unpacker.pyx"
    __pyx_v_self->encoding = __pyx_v_encoding;

    /* "msgpack/_unpacker.pyx":230
 *                 encoding = encoding.encode('ascii')
 *             self.encoding = encoding
 *             cenc = PyBytes_AsString(encoding)             # <<<<<<<<<<<<<<
 * 
 *         if unicode_errors is not None:
 */

#line 230 "msgpack/_unpacker.pyx"
    __pyx_t_7 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 230 "msgpack/_unpacker.pyx"
    __pyx_v_cenc = __pyx_t_7;

#line 230 "msgpack/_unpacker.pyx"
    goto __pyx_L9;

#line 230 "msgpack/_unpacker.pyx"
  }

#line 230 "msgpack/_unpacker.pyx"
  __pyx_L9:;

  /* "msgpack/_unpacker.pyx":232
 *             cenc = PyBytes_AsString(encoding)
 * 
 *         if unicode_errors is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(unicode_errors, unicode):
 *                 unicode_errors = unicode_errors.encode('ascii')
 */

#line 232 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_unicode_errors != Py_None);

#line 232 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":233
 * 
 *         if unicode_errors is not None:
 *             if isinstance(unicode_errors, unicode):             # <<<<<<<<<<<<<<
 *                 unicode_errors = unicode_errors.encode('ascii')
 *             self.unicode_errors = unicode_errors
 */

#line 233 "msgpack/_unpacker.pyx"
    __pyx_t_1 = PyUnicode_Check(__pyx_v_unicode_errors); 

#line 233 "msgpack/_unpacker.pyx"
    if (__pyx_t_1) {

      /* "msgpack/_unpacker.pyx":234
 *         if unicode_errors is not None:
 *             if isinstance(unicode_errors, unicode):
 *                 unicode_errors = unicode_errors.encode('ascii')             # <<<<<<<<<<<<<<
 *             self.unicode_errors = unicode_errors
 *             cerr = PyBytes_AsString(unicode_errors)
 */

#line 234 "msgpack/_unpacker.pyx"
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_unicode_errors, __pyx_n_s__encode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 234 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_6);

#line 234 "msgpack/_unpacker.pyx"
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 234 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_2);

#line 234 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

#line 234 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_v_unicode_errors);

#line 234 "msgpack/_unpacker.pyx"
      __pyx_v_unicode_errors = __pyx_t_2;

#line 234 "msgpack/_unpacker.pyx"
      __pyx_t_2 = 0;

#line 234 "msgpack/_unpacker.pyx"
      goto __pyx_L12;

#line 234 "msgpack/_unpacker.pyx"
    }

#line 234 "msgpack/_unpacker.pyx"
    __pyx_L12:;

    /* "msgpack/_unpacker.pyx":235
 *             if isinstance(unicode_errors, unicode):
 *                 unicode_errors = unicode_errors.encode('ascii')
 *             self.unicode_errors = unicode_errors             # <<<<<<<<<<<<<<
 *             cerr = PyBytes_AsString(unicode_errors)
 * 
 */

#line 235 "msgpack/_unpacker.pyx"
    __Pyx_INCREF(__pyx_v_unicode_errors);

#line 235 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(__pyx_v_unicode_errors);

#line 235 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_v_self->unicode_errors);

#line 235 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_v_self->unicode_errors);

#line 235 "msgpack/_unpacker.pyx"
    __pyx_v_self->unicode_errors = __pyx_v_unicode_errors;

    /* "msgpack/_unpacker.pyx":236
 *                 unicode_errors = unicode_errors.encode('ascii')
 *             self.unicode_errors = unicode_errors
 *             cerr = PyBytes_AsString(unicode_errors)             # <<<<<<<<<<<<<<
 * 
 *         init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
 */

#line 236 "msgpack/_unpacker.pyx"
    __pyx_t_7 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 236 "msgpack/_unpacker.pyx"
    __pyx_v_cerr = __pyx_t_7;

#line 236 "msgpack/_unpacker.pyx"
    goto __pyx_L11;

#line 236 "msgpack/_unpacker.pyx"
  }

#line 236 "msgpack/_unpacker.pyx"
  __pyx_L11:;

  /* "msgpack/_unpacker.pyx":238
 *             cerr = PyBytes_AsString(unicode_errors)
 * 
 *         init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)             # <<<<<<<<<<<<<<
 * 
 *     def feed(self, object next_bytes):
 */

#line 238 "msgpack/_unpacker.pyx"
  __pyx_t_2 = __pyx_f_7msgpack_9_unpacker_init_ctx((&__pyx_v_self->ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 238 "msgpack/_unpacker.pyx"


#line 238 "msgpack/_unpacker.pyx"
  __pyx_r = 0;

#line 238 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 238 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_2);

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_6);

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 238 "msgpack/_unpacker.pyx"
  __pyx_r = -1;

#line 238 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_encoding);

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_unicode_errors);

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 238 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 238 "msgpack/_unpacker.pyx"
}

#line 238 "msgpack/_unpacker.pyx"


#line 238 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 238 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes); /*proto*/

#line 238 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_8Unpacker_6feed[] = "Unpacker.feed(self, next_bytes)\nAppend `next_bytes` to internal buffer.";

#line 238 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes) {

#line 238 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  __pyx_r = 
#line 238 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_6feed(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), ((PyObject *)__pyx_v_next_bytes));

#line 238 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 238 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 238 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":240
 *         init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
 * 
 *     def feed(self, object next_bytes):             # <<<<<<<<<<<<<<
 *         """Append `next_bytes` to internal buffer."""
 *         cdef char* buf
 */

#line 240 "msgpack/_unpacker.pyx"


#line 240 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_6feed(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes) {
  char *__pyx_v_buf
#line 240 "msgpack/_unpacker.pyx"
;
  Py_ssize_t __pyx_v_buf_len
#line 240 "msgpack/_unpacker.pyx"
;

#line 240 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 240 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("feed", 0);

  /* "msgpack/_unpacker.pyx":244
 *         cdef char* buf
 *         cdef Py_ssize_t buf_len
 *         if self.file_like is not None:             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                     "unpacker.feed() is not be able to use with `file_like`.")
 */

#line 244 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_self->file_like != Py_None);

#line 244 "msgpack/_unpacker.pyx"
  if (__pyx_t_1) {

    /* "msgpack/_unpacker.pyx":245
 *         cdef Py_ssize_t buf_len
 *         if self.file_like is not None:
 *             raise AssertionError(             # <<<<<<<<<<<<<<
 *                     "unpacker.feed() is not be able to use with `file_like`.")
 *         PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)
 */

#line 245 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 245 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_2);

#line 245 "msgpack/_unpacker.pyx"
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);

#line 245 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 245 "msgpack/_unpacker.pyx"
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 245 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 245 "msgpack/_unpacker.pyx"
  }

#line 245 "msgpack/_unpacker.pyx"
  __pyx_L3:;

  /* "msgpack/_unpacker.pyx":247
 *             raise AssertionError(
 *                     "unpacker.feed() is not be able to use with `file_like`.")
 *         PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)             # <<<<<<<<<<<<<<
 *         self.append_buffer(buf, buf_len)
 * 
 */

#line 247 "msgpack/_unpacker.pyx"
  __pyx_t_3 = PyObject_AsReadBuffer(__pyx_v_next_bytes, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "msgpack/_unpacker.pyx":248
 *                     "unpacker.feed() is not be able to use with `file_like`.")
 *         PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)
 *         self.append_buffer(buf, buf_len)             # <<<<<<<<<<<<<<
 * 
 *     cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len):
 */

#line 248 "msgpack/_unpacker.pyx"
  __pyx_t_2 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 248 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 248 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

#line 248 "msgpack/_unpacker.pyx"


#line 248 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 248 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 248 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 248 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_2);

#line 248 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 248 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 248 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 248 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 248 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 248 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 248 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":250
 *         self.append_buffer(buf, buf_len)
 * 
 *     cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char* buf = self.buf
 */

#line 250 "msgpack/_unpacker.pyx"


#line 250 "msgpack/_unpacker.pyx"
static PyObject *__pyx_f_7msgpack_9_unpacker_8Unpacker_append_buffer(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, void *__pyx_v__buf, Py_ssize_t __pyx_v__buf_len) {
  char *__pyx_v_buf
#line 250 "msgpack/_unpacker.pyx"
;
  char *__pyx_v_new_buf
#line 250 "msgpack/_unpacker.pyx"
;
  size_t __pyx_v_head
#line 250 "msgpack/_unpacker.pyx"
;
  size_t __pyx_v_tail
#line 250 "msgpack/_unpacker.pyx"
;
  size_t __pyx_v_buf_size
#line 250 "msgpack/_unpacker.pyx"
;
  size_t __pyx_v_new_size
#line 250 "msgpack/_unpacker.pyx"
;

#line 250 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  size_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 250 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("append_buffer", 0);

  /* "msgpack/_unpacker.pyx":252
 *     cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len):
 *         cdef:
 *             char* buf = self.buf             # <<<<<<<<<<<<<<
 *             char* new_buf
 *             size_t head = self.buf_head
 */

#line 252 "msgpack/_unpacker.pyx"
  __pyx_t_1 = __pyx_v_self->buf;

#line 252 "msgpack/_unpacker.pyx"
  __pyx_v_buf = __pyx_t_1;

  /* "msgpack/_unpacker.pyx":254
 *             char* buf = self.buf
 *             char* new_buf
 *             size_t head = self.buf_head             # <<<<<<<<<<<<<<
 *             size_t tail = self.buf_tail
 *             size_t buf_size = self.buf_size
 */

#line 254 "msgpack/_unpacker.pyx"
  __pyx_t_2 = __pyx_v_self->buf_head;

#line 254 "msgpack/_unpacker.pyx"
  __pyx_v_head = __pyx_t_2;

  /* "msgpack/_unpacker.pyx":255
 *             char* new_buf
 *             size_t head = self.buf_head
 *             size_t tail = self.buf_tail             # <<<<<<<<<<<<<<
 *             size_t buf_size = self.buf_size
 *             size_t new_size
 */

#line 255 "msgpack/_unpacker.pyx"
  __pyx_t_2 = __pyx_v_self->buf_tail;

#line 255 "msgpack/_unpacker.pyx"
  __pyx_v_tail = __pyx_t_2;

  /* "msgpack/_unpacker.pyx":256
 *             size_t head = self.buf_head
 *             size_t tail = self.buf_tail
 *             size_t buf_size = self.buf_size             # <<<<<<<<<<<<<<
 *             size_t new_size
 * 
 */

#line 256 "msgpack/_unpacker.pyx"
  __pyx_t_2 = __pyx_v_self->buf_size;

#line 256 "msgpack/_unpacker.pyx"
  __pyx_v_buf_size = __pyx_t_2;

  /* "msgpack/_unpacker.pyx":259
 *             size_t new_size
 * 
 *         if tail + _buf_len > buf_size:             # <<<<<<<<<<<<<<
 *             if ((tail - head) + _buf_len) <= buf_size:
 *                 # move to front.
 */

#line 259 "msgpack/_unpacker.pyx"
  __pyx_t_3 = ((__pyx_v_tail + __pyx_v__buf_len) > __pyx_v_buf_size);

#line 259 "msgpack/_unpacker.pyx"
  if (__pyx_t_3) {

    /* "msgpack/_unpacker.pyx":260
 * 
 *         if tail + _buf_len > buf_size:
 *             if ((tail - head) + _buf_len) <= buf_size:             # <<<<<<<<<<<<<<
 *                 # move to front.
 *                 memmove(buf, buf + head, tail - head)
 */

#line 260 "msgpack/_unpacker.pyx"
    __pyx_t_3 = (((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len) <= __pyx_v_buf_size);

#line 260 "msgpack/_unpacker.pyx"
    if (__pyx_t_3) {

      /* "msgpack/_unpacker.pyx":262
 *             if ((tail - head) + _buf_len) <= buf_size:
 *                 # move to front.
 *                 memmove(buf, buf + head, tail - head)             # <<<<<<<<<<<<<<
 *                 tail -= head
 *                 head = 0
 */

#line 262 "msgpack/_unpacker.pyx"
      memmove(__pyx_v_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head));

      /* "msgpack/_unpacker.pyx":263
 *                 # move to front.
 *                 memmove(buf, buf + head, tail - head)
 *                 tail -= head             # <<<<<<<<<<<<<<
 *                 head = 0
 *             else:
 */

#line 263 "msgpack/_unpacker.pyx"
      __pyx_v_tail = (__pyx_v_tail - __pyx_v_head);

      /* "msgpack/_unpacker.pyx":264
 *                 memmove(buf, buf + head, tail - head)
 *                 tail -= head
 *                 head = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 # expand buffer.
 */

#line 264 "msgpack/_unpacker.pyx"
      __pyx_v_head = 0;

#line 264 "msgpack/_unpacker.pyx"
      goto __pyx_L4;

#line 264 "msgpack/_unpacker.pyx"
    }

#line 264 "msgpack/_unpacker.pyx"
    /*else*/ {

      /* "msgpack/_unpacker.pyx":267
 *             else:
 *                 # expand buffer.
 *                 new_size = (tail-head) + _buf_len             # <<<<<<<<<<<<<<
 *                 if new_size > self.max_buffer_size:
 *                     raise BufferFull
 */

#line 267 "msgpack/_unpacker.pyx"
      __pyx_v_new_size = ((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len);

      /* "msgpack/_unpacker.pyx":268
 *                 # expand buffer.
 *                 new_size = (tail-head) + _buf_len
 *                 if new_size > self.max_buffer_size:             # <<<<<<<<<<<<<<
 *                     raise BufferFull
 *                 new_size = min(new_size*2, self.max_buffer_size)
 */

#line 268 "msgpack/_unpacker.pyx"
      __pyx_t_3 = (__pyx_v_new_size > __pyx_v_self->max_buffer_size);

#line 268 "msgpack/_unpacker.pyx"
      if (__pyx_t_3) {

        /* "msgpack/_unpacker.pyx":269
 *                 new_size = (tail-head) + _buf_len
 *                 if new_size > self.max_buffer_size:
 *                     raise BufferFull             # <<<<<<<<<<<<<<
 *                 new_size = min(new_size*2, self.max_buffer_size)
 *                 new_buf = <char*>malloc(new_size)
 */

#line 269 "msgpack/_unpacker.pyx"
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__BufferFull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 269 "msgpack/_unpacker.pyx"
        __Pyx_GOTREF(__pyx_t_4);

#line 269 "msgpack/_unpacker.pyx"
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 269 "msgpack/_unpacker.pyx"
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 269 "msgpack/_unpacker.pyx"
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 269 "msgpack/_unpacker.pyx"
        goto __pyx_L5;

#line 269 "msgpack/_unpacker.pyx"
      }

#line 269 "msgpack/_unpacker.pyx"
      __pyx_L5:;

      /* "msgpack/_unpacker.pyx":270
 *                 if new_size > self.max_buffer_size:
 *                     raise BufferFull
 *                 new_size = min(new_size*2, self.max_buffer_size)             # <<<<<<<<<<<<<<
 *                 new_buf = <char*>malloc(new_size)
 *                 if new_buf == NULL:
 */

#line 270 "msgpack/_unpacker.pyx"
      __pyx_t_2 = __pyx_v_self->max_buffer_size;

#line 270 "msgpack/_unpacker.pyx"
      __pyx_t_5 = (__pyx_v_new_size * 2);

#line 270 "msgpack/_unpacker.pyx"
      if ((__pyx_t_2 < __pyx_t_5)) {

#line 270 "msgpack/_unpacker.pyx"
        __pyx_t_6 = __pyx_t_2;

#line 270 "msgpack/_unpacker.pyx"
      } else {

#line 270 "msgpack/_unpacker.pyx"
        __pyx_t_6 = __pyx_t_5;

#line 270 "msgpack/_unpacker.pyx"
      }

#line 270 "msgpack/_unpacker.pyx"
      __pyx_v_new_size = __pyx_t_6;

      /* "msgpack/_unpacker.pyx":271
 *                     raise BufferFull
 *                 new_size = min(new_size*2, self.max_buffer_size)
 *                 new_buf = <char*>malloc(new_size)             # <<<<<<<<<<<<<<
 *                 if new_buf == NULL:
 *                     # self.buf still holds old buffer and will be freed during
 */

#line 271 "msgpack/_unpacker.pyx"
      __pyx_v_new_buf = ((char *)malloc(__pyx_v_new_size));

      /* "msgpack/_unpacker.pyx":272
 *                 new_size = min(new_size*2, self.max_buffer_size)
 *                 new_buf = <char*>malloc(new_size)
 *                 if new_buf == NULL:             # <<<<<<<<<<<<<<
 *                     # self.buf still holds old buffer and will be freed during
 *                     # obj destruction
 */

#line 272 "msgpack/_unpacker.pyx"
      __pyx_t_3 = (__pyx_v_new_buf == NULL);

#line 272 "msgpack/_unpacker.pyx"
      if (__pyx_t_3) {

        /* "msgpack/_unpacker.pyx":275
 *                     # self.buf still holds old buffer and will be freed during
 *                     # obj destruction
 *                     raise MemoryError("Unable to enlarge internal buffer.")             # <<<<<<<<<<<<<<
 *                 memcpy(new_buf, buf + head, tail - head)
 *                 free(buf)
 */

#line 275 "msgpack/_unpacker.pyx"
        __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 275 "msgpack/_unpacker.pyx"
        __Pyx_GOTREF(__pyx_t_4);

#line 275 "msgpack/_unpacker.pyx"
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 275 "msgpack/_unpacker.pyx"
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 275 "msgpack/_unpacker.pyx"
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 275 "msgpack/_unpacker.pyx"
        goto __pyx_L6;

#line 275 "msgpack/_unpacker.pyx"
      }

#line 275 "msgpack/_unpacker.pyx"
      __pyx_L6:;

      /* "msgpack/_unpacker.pyx":276
 *                     # obj destruction
 *                     raise MemoryError("Unable to enlarge internal buffer.")
 *                 memcpy(new_buf, buf + head, tail - head)             # <<<<<<<<<<<<<<
 *                 free(buf)
 * 
 */

#line 276 "msgpack/_unpacker.pyx"
      memcpy(__pyx_v_new_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head));

      /* "msgpack/_unpacker.pyx":277
 *                     raise MemoryError("Unable to enlarge internal buffer.")
 *                 memcpy(new_buf, buf + head, tail - head)
 *                 free(buf)             # <<<<<<<<<<<<<<
 * 
 *                 buf = new_buf
 */

#line 277 "msgpack/_unpacker.pyx"
      free(__pyx_v_buf);

      /* "msgpack/_unpacker.pyx":279
 *                 free(buf)
 * 
 *                 buf = new_buf             # <<<<<<<<<<<<<<
 *                 buf_size = new_size
 *                 tail -= head
 */

#line 279 "msgpack/_unpacker.pyx"
      __pyx_v_buf = __pyx_v_new_buf;

      /* "msgpack/_unpacker.pyx":280
 * 
 *                 buf = new_buf
 *                 buf_size = new_size             # <<<<<<<<<<<<<<
 *                 tail -= head
 *                 head = 0
 */

#line 280 "msgpack/_unpacker.pyx"
      __pyx_v_buf_size = __pyx_v_new_size;

      /* "msgpack/_unpacker.pyx":281
 *                 buf = new_buf
 *                 buf_size = new_size
 *                 tail -= head             # <<<<<<<<<<<<<<
 *                 head = 0
 * 
 */

#line 281 "msgpack/_unpacker.pyx"
      __pyx_v_tail = (__pyx_v_tail - __pyx_v_head);

      /* "msgpack/_unpacker.pyx":282
 *                 buf_size = new_size
 *                 tail -= head
 *                 head = 0             # <<<<<<<<<<<<<<
 * 
 *         memcpy(buf + tail, <char*>(_buf), _buf_len)
 */

#line 282 "msgpack/_unpacker.pyx"
      __pyx_v_head = 0;

#line 282 "msgpack/_unpacker.pyx"
    }

#line 282 "msgpack/_unpacker.pyx"
    __pyx_L4:;

#line 282 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 282 "msgpack/_unpacker.pyx"
  }

#line 282 "msgpack/_unpacker.pyx"
  __pyx_L3:;

  /* "msgpack/_unpacker.pyx":284
 *                 head = 0
 * 
 *         memcpy(buf + tail, <char*>(_buf), _buf_len)             # <<<<<<<<<<<<<<
 *         self.buf = buf
 *         self.buf_head = head
 */

#line 284 "msgpack/_unpacker.pyx"
  memcpy((__pyx_v_buf + __pyx_v_tail), ((char *)__pyx_v__buf), __pyx_v__buf_len);

  /* "msgpack/_unpacker.pyx":285
 * 
 *         memcpy(buf + tail, <char*>(_buf), _buf_len)
 *         self.buf = buf             # <<<<<<<<<<<<<<
 *         self.buf_head = head
 *         self.buf_size = buf_size
 */

#line 285 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf = __pyx_v_buf;

  /* "msgpack/_unpacker.pyx":286
 *         memcpy(buf + tail, <char*>(_buf), _buf_len)
 *         self.buf = buf
 *         self.buf_head = head             # <<<<<<<<<<<<<<
 *         self.buf_size = buf_size
 *         self.buf_tail = tail + _buf_len
 */

#line 286 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_head = __pyx_v_head;

  /* "msgpack/_unpacker.pyx":287
 *         self.buf = buf
 *         self.buf_head = head
 *         self.buf_size = buf_size             # <<<<<<<<<<<<<<
 *         self.buf_tail = tail + _buf_len
 * 
 */

#line 287 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_size = __pyx_v_buf_size;

  /* "msgpack/_unpacker.pyx":288
 *         self.buf_head = head
 *         self.buf_size = buf_size
 *         self.buf_tail = tail + _buf_len             # <<<<<<<<<<<<<<
 * 
 *     cdef read_from_file(self):
 */

#line 288 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_tail = (__pyx_v_tail + __pyx_v__buf_len);

#line 288 "msgpack/_unpacker.pyx"


#line 288 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 288 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 288 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 288 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 288 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.append_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 288 "msgpack/_unpacker.pyx"
  __pyx_r = 0;

#line 288 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 288 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 288 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 288 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 288 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":290
 *         self.buf_tail = tail + _buf_len
 * 
 *     cdef read_from_file(self):             # <<<<<<<<<<<<<<
 *         next_bytes = self.file_like_read(
 *                 min(self.read_size,
 */

#line 290 "msgpack/_unpacker.pyx"


#line 290 "msgpack/_unpacker.pyx"
static PyObject *__pyx_f_7msgpack_9_unpacker_8Unpacker_read_from_file(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self) {
  PyObject *__pyx_v_next_bytes = NULL
#line 290 "msgpack/_unpacker.pyx"
;

#line 290 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 290 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_from_file", 0);

  /* "msgpack/_unpacker.pyx":293
 *         next_bytes = self.file_like_read(
 *                 min(self.read_size,
 *                     self.max_buffer_size - (self.buf_tail - self.buf_head)             # <<<<<<<<<<<<<<
 *                     ))
 *         if next_bytes:
 */

#line 293 "msgpack/_unpacker.pyx"
  __pyx_t_1 = (__pyx_v_self->max_buffer_size - (__pyx_v_self->buf_tail - __pyx_v_self->buf_head));

  /* "msgpack/_unpacker.pyx":292
 *     cdef read_from_file(self):
 *         next_bytes = self.file_like_read(
 *                 min(self.read_size,             # <<<<<<<<<<<<<<
 *                     self.max_buffer_size - (self.buf_tail - self.buf_head)
 *                     ))
 */

#line 292 "msgpack/_unpacker.pyx"
  __pyx_t_2 = __pyx_v_self->read_size;

  /* "msgpack/_unpacker.pyx":293
 *         next_bytes = self.file_like_read(
 *                 min(self.read_size,
 *                     self.max_buffer_size - (self.buf_tail - self.buf_head)             # <<<<<<<<<<<<<<
 *                     ))
 *         if next_bytes:
 */

#line 293 "msgpack/_unpacker.pyx"
  if ((__pyx_t_1 < __pyx_t_2)) {

#line 293 "msgpack/_unpacker.pyx"
    __pyx_t_3 = __pyx_t_1;

#line 293 "msgpack/_unpacker.pyx"
  } else {

#line 293 "msgpack/_unpacker.pyx"
    __pyx_t_3 = __pyx_t_2;

#line 293 "msgpack/_unpacker.pyx"
  }

#line 293 "msgpack/_unpacker.pyx"
  __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 293 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_4);

#line 293 "msgpack/_unpacker.pyx"
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 293 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_5);

#line 293 "msgpack/_unpacker.pyx"
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);

#line 293 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(__pyx_t_4);

#line 293 "msgpack/_unpacker.pyx"
  __pyx_t_4 = 0;

#line 293 "msgpack/_unpacker.pyx"
  __pyx_t_4 = PyObject_Call(__pyx_v_self->file_like_read, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 293 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_4);

#line 293 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

#line 293 "msgpack/_unpacker.pyx"
  __pyx_v_next_bytes = __pyx_t_4;

#line 293 "msgpack/_unpacker.pyx"
  __pyx_t_4 = 0;

  /* "msgpack/_unpacker.pyx":295
 *                     self.max_buffer_size - (self.buf_tail - self.buf_head)
 *                     ))
 *         if next_bytes:             # <<<<<<<<<<<<<<
 *             self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes))
 *         else:
 */

#line 295 "msgpack/_unpacker.pyx"
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_next_bytes); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 295 "msgpack/_unpacker.pyx"
  if (__pyx_t_6) {

    /* "msgpack/_unpacker.pyx":296
 *                     ))
 *         if next_bytes:
 *             self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes))             # <<<<<<<<<<<<<<
 *         else:
 *             self.file_like = None
 */

#line 296 "msgpack/_unpacker.pyx"
    __pyx_t_7 = PyBytes_AsString(__pyx_v_next_bytes); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 296 "msgpack/_unpacker.pyx"
    __pyx_t_2 = PyBytes_Size(__pyx_v_next_bytes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 296 "msgpack/_unpacker.pyx"
    __pyx_t_4 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 296 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_4);

#line 296 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 296 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 296 "msgpack/_unpacker.pyx"
  }

#line 296 "msgpack/_unpacker.pyx"
  /*else*/ {

    /* "msgpack/_unpacker.pyx":298
 *             self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes))
 *         else:
 *             self.file_like = None             # <<<<<<<<<<<<<<
 * 
 *     cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0):
 */

#line 298 "msgpack/_unpacker.pyx"
    __Pyx_INCREF(Py_None);

#line 298 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(Py_None);

#line 298 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_v_self->file_like);

#line 298 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_v_self->file_like);

#line 298 "msgpack/_unpacker.pyx"
    __pyx_v_self->file_like = Py_None;

#line 298 "msgpack/_unpacker.pyx"
  }

#line 298 "msgpack/_unpacker.pyx"
  __pyx_L3:;

#line 298 "msgpack/_unpacker.pyx"


#line 298 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 298 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 298 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 298 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 298 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_5);

#line 298 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 298 "msgpack/_unpacker.pyx"
  __pyx_r = 0;

#line 298 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 298 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_next_bytes);

#line 298 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 298 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 298 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 298 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":300
 *             self.file_like = None
 * 
 *     cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0):             # <<<<<<<<<<<<<<
 *         cdef int ret
 *         cdef object obj
 */

#line 300 "msgpack/_unpacker.pyx"


#line 300 "msgpack/_unpacker.pyx"
static PyObject *__pyx_f_7msgpack_9_unpacker_8Unpacker__unpack(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, execute_fn __pyx_v_execute, PyObject *__pyx_v_write_bytes, struct __pyx_opt_args_7msgpack_9_unpacker_8Unpacker__unpack *__pyx_optional_args) {

#line 300 "msgpack/_unpacker.pyx"
  int __pyx_v_iter = ((int)0);
  int __pyx_v_ret
#line 300 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_obj = 0
#line 300 "msgpack/_unpacker.pyx"
;
  size_t __pyx_v_prev_head
#line 300 "msgpack/_unpacker.pyx"
;

#line 300 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  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;

#line 300 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("_unpack", 0);

#line 300 "msgpack/_unpacker.pyx"
  if (__pyx_optional_args) {

#line 300 "msgpack/_unpacker.pyx"
    if (__pyx_optional_args->__pyx_n > 0) {

#line 300 "msgpack/_unpacker.pyx"
      __pyx_v_iter = __pyx_optional_args->iter;

#line 300 "msgpack/_unpacker.pyx"
    }

#line 300 "msgpack/_unpacker.pyx"
  }

  /* "msgpack/_unpacker.pyx":304
 *         cdef object obj
 *         cdef size_t prev_head
 *         while 1:             # <<<<<<<<<<<<<<
 *             prev_head = self.buf_head
 *             ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
 */

#line 304 "msgpack/_unpacker.pyx"
  while (1) {

#line 304 "msgpack/_unpacker.pyx"
    if (!1) break;

    /* "msgpack/_unpacker.pyx":305
 *         cdef size_t prev_head
 *         while 1:
 *             prev_head = self.buf_head             # <<<<<<<<<<<<<<
 *             ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
 *             if write_bytes is not None:
 */

#line 305 "msgpack/_unpacker.pyx"
    __pyx_t_1 = __pyx_v_self->buf_head;

#line 305 "msgpack/_unpacker.pyx"
    __pyx_v_prev_head = __pyx_t_1;

    /* "msgpack/_unpacker.pyx":306
 *         while 1:
 *             prev_head = self.buf_head
 *             ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)             # <<<<<<<<<<<<<<
 *             if write_bytes is not None:
 *                 write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
 */

#line 306 "msgpack/_unpacker.pyx"
    __pyx_t_2 = __pyx_v_execute((&__pyx_v_self->ctx), __pyx_v_self->buf, __pyx_v_self->buf_tail, (&__pyx_v_self->buf_head)); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 306 "msgpack/_unpacker.pyx"
    __pyx_v_ret = __pyx_t_2;

    /* "msgpack/_unpacker.pyx":307
 *             prev_head = self.buf_head
 *             ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
 *             if write_bytes is not None:             # <<<<<<<<<<<<<<
 *                 write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
 * 
 */

#line 307 "msgpack/_unpacker.pyx"
    __pyx_t_3 = (__pyx_v_write_bytes != Py_None);

#line 307 "msgpack/_unpacker.pyx"
    if (__pyx_t_3) {

      /* "msgpack/_unpacker.pyx":308
 *             ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
 *             if write_bytes is not None:
 *                 write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))             # <<<<<<<<<<<<<<
 * 
 *             if ret == 1:
 */

#line 308 "msgpack/_unpacker.pyx"
      __pyx_t_4 = ((PyObject *)PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_prev_head), (__pyx_v_self->buf_head - __pyx_v_prev_head))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 308 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 308 "msgpack/_unpacker.pyx"
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 308 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_5);

#line 308 "msgpack/_unpacker.pyx"
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);

#line 308 "msgpack/_unpacker.pyx"
      __Pyx_GIVEREF(__pyx_t_4);

#line 308 "msgpack/_unpacker.pyx"
      __pyx_t_4 = 0;

#line 308 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyObject_Call(__pyx_v_write_bytes, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 308 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 308 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

#line 308 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 308 "msgpack/_unpacker.pyx"
      goto __pyx_L5;

#line 308 "msgpack/_unpacker.pyx"
    }

#line 308 "msgpack/_unpacker.pyx"
    __pyx_L5:;

    /* "msgpack/_unpacker.pyx":314
 *                 template_init(&self.ctx)
 *                 return obj
 *             elif ret == 0:             # <<<<<<<<<<<<<<
 *                 if self.file_like is not None:
 *                     self.read_from_file()
 */

#line 314 "msgpack/_unpacker.pyx"
    switch (__pyx_v_ret) {

      /* "msgpack/_unpacker.pyx":310
 *                 write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
 * 
 *             if ret == 1:             # <<<<<<<<<<<<<<
 *                 obj = template_data(&self.ctx)
 *                 template_init(&self.ctx)
 */

#line 310 "msgpack/_unpacker.pyx"
      case 1:

      /* "msgpack/_unpacker.pyx":311
 * 
 *             if ret == 1:
 *                 obj = template_data(&self.ctx)             # <<<<<<<<<<<<<<
 *                 template_init(&self.ctx)
 *                 return obj
 */

#line 311 "msgpack/_unpacker.pyx"
      __pyx_t_4 = template_data((&__pyx_v_self->ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 311 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 311 "msgpack/_unpacker.pyx"
      __pyx_v_obj = __pyx_t_4;

#line 311 "msgpack/_unpacker.pyx"
      __pyx_t_4 = 0;

      /* "msgpack/_unpacker.pyx":312
 *             if ret == 1:
 *                 obj = template_data(&self.ctx)
 *                 template_init(&self.ctx)             # <<<<<<<<<<<<<<
 *                 return obj
 *             elif ret == 0:
 */

#line 312 "msgpack/_unpacker.pyx"
      template_init((&__pyx_v_self->ctx));

      /* "msgpack/_unpacker.pyx":313
 *                 obj = template_data(&self.ctx)
 *                 template_init(&self.ctx)
 *                 return obj             # <<<<<<<<<<<<<<
 *             elif ret == 0:
 *                 if self.file_like is not None:
 */

#line 313 "msgpack/_unpacker.pyx"
      __Pyx_XDECREF(__pyx_r);

#line 313 "msgpack/_unpacker.pyx"
      __Pyx_INCREF(__pyx_v_obj);

#line 313 "msgpack/_unpacker.pyx"
      __pyx_r = __pyx_v_obj;

#line 313 "msgpack/_unpacker.pyx"
      goto __pyx_L0;

#line 313 "msgpack/_unpacker.pyx"
      break;

      /* "msgpack/_unpacker.pyx":314
 *                 template_init(&self.ctx)
 *                 return obj
 *             elif ret == 0:             # <<<<<<<<<<<<<<
 *                 if self.file_like is not None:
 *                     self.read_from_file()
 */

#line 314 "msgpack/_unpacker.pyx"
      case 0:

      /* "msgpack/_unpacker.pyx":315
 *                 return obj
 *             elif ret == 0:
 *                 if self.file_like is not None:             # <<<<<<<<<<<<<<
 *                     self.read_from_file()
 *                     continue
 */

#line 315 "msgpack/_unpacker.pyx"
      __pyx_t_3 = (__pyx_v_self->file_like != Py_None);

#line 315 "msgpack/_unpacker.pyx"
      if (__pyx_t_3) {

        /* "msgpack/_unpacker.pyx":316
 *             elif ret == 0:
 *                 if self.file_like is not None:
 *                     self.read_from_file()             # <<<<<<<<<<<<<<
 *                     continue
 *                 if iter:
 */

#line 316 "msgpack/_unpacker.pyx"
        __pyx_t_4 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->read_from_file(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 316 "msgpack/_unpacker.pyx"
        __Pyx_GOTREF(__pyx_t_4);

#line 316 "msgpack/_unpacker.pyx"
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "msgpack/_unpacker.pyx":317
 *                 if self.file_like is not None:
 *                     self.read_from_file()
 *                     continue             # <<<<<<<<<<<<<<
 *                 if iter:
 *                     raise StopIteration("No more data to unpack.")
 */

#line 317 "msgpack/_unpacker.pyx"
        goto __pyx_L3_continue;

#line 317 "msgpack/_unpacker.pyx"
        goto __pyx_L6;

#line 317 "msgpack/_unpacker.pyx"
      }

#line 317 "msgpack/_unpacker.pyx"
      __pyx_L6:;

      /* "msgpack/_unpacker.pyx":318
 *                     self.read_from_file()
 *                     continue
 *                 if iter:             # <<<<<<<<<<<<<<
 *                     raise StopIteration("No more data to unpack.")
 *                 else:
 */

#line 318 "msgpack/_unpacker.pyx"
      if (__pyx_v_iter) {

        /* "msgpack/_unpacker.pyx":319
 *                     continue
 *                 if iter:
 *                     raise StopIteration("No more data to unpack.")             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise OutOfData("No more data to unpack.")
 */

#line 319 "msgpack/_unpacker.pyx"
        __pyx_t_4 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 319 "msgpack/_unpacker.pyx"
        __Pyx_GOTREF(__pyx_t_4);

#line 319 "msgpack/_unpacker.pyx"
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);

#line 319 "msgpack/_unpacker.pyx"
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 319 "msgpack/_unpacker.pyx"
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 319 "msgpack/_unpacker.pyx"
        goto __pyx_L7;

#line 319 "msgpack/_unpacker.pyx"
      }

#line 319 "msgpack/_unpacker.pyx"
      /*else*/ {

        /* "msgpack/_unpacker.pyx":321
 *                     raise StopIteration("No more data to unpack.")
 *                 else:
 *                     raise OutOfData("No more data to unpack.")             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("Unpack failed: error = %d" % (ret,))
 */

#line 321 "msgpack/_unpacker.pyx"
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__OutOfData); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 321 "msgpack/_unpacker.pyx"
        __Pyx_GOTREF(__pyx_t_4);

#line 321 "msgpack/_unpacker.pyx"
        __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 321 "msgpack/_unpacker.pyx"
        __Pyx_GOTREF(__pyx_t_5);

#line 321 "msgpack/_unpacker.pyx"
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 321 "msgpack/_unpacker.pyx"
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);

#line 321 "msgpack/_unpacker.pyx"
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

#line 321 "msgpack/_unpacker.pyx"
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 321 "msgpack/_unpacker.pyx"
      }

#line 321 "msgpack/_unpacker.pyx"
      __pyx_L7:;

#line 321 "msgpack/_unpacker.pyx"
      break;

#line 321 "msgpack/_unpacker.pyx"
      default:

      /* "msgpack/_unpacker.pyx":323
 *                     raise OutOfData("No more data to unpack.")
 *             else:
 *                 raise ValueError("Unpack failed: error = %d" % (ret,))             # <<<<<<<<<<<<<<
 * 
 *     def read_bytes(self, Py_ssize_t nbytes):
 */

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_5 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_5);

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 323 "msgpack/_unpacker.pyx"
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GIVEREF(__pyx_t_5);

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_5 = 0;

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_4);

#line 323 "msgpack/_unpacker.pyx"
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GIVEREF(((PyObject *)__pyx_t_5));

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_5 = 0;

#line 323 "msgpack/_unpacker.pyx"
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_GOTREF(__pyx_t_5);

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);

#line 323 "msgpack/_unpacker.pyx"
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

#line 323 "msgpack/_unpacker.pyx"
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 323 "msgpack/_unpacker.pyx"
      break;

#line 323 "msgpack/_unpacker.pyx"
    }

#line 323 "msgpack/_unpacker.pyx"
    __pyx_L3_continue:;

#line 323 "msgpack/_unpacker.pyx"
  }

#line 323 "msgpack/_unpacker.pyx"


#line 323 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 323 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 323 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_5);

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker._unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 323 "msgpack/_unpacker.pyx"
  __pyx_r = 0;

#line 323 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_obj);

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 323 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 323 "msgpack/_unpacker.pyx"
}

#line 323 "msgpack/_unpacker.pyx"


#line 323 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 323 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes); /*proto*/

#line 323 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_8Unpacker_8read_bytes[] = "Unpacker.read_bytes(self, Py_ssize_t nbytes)\nread a specified number of raw bytes from the stream";

#line 323 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes) {
  Py_ssize_t __pyx_v_nbytes
#line 323 "msgpack/_unpacker.pyx"
;

#line 323 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_bytes (wrapper)", 0);

#line 323 "msgpack/_unpacker.pyx"
  assert(__pyx_arg_nbytes); {

#line 323 "msgpack/_unpacker.pyx"
    __pyx_v_nbytes = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nbytes); if (unlikely((__pyx_v_nbytes == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 323 "msgpack/_unpacker.pyx"
  }

#line 323 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 323 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 323 "msgpack/_unpacker.pyx"
  return NULL;

#line 323 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 323 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_8read_bytes(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nbytes));

#line 323 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 323 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 323 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":325
 *                 raise ValueError("Unpack failed: error = %d" % (ret,))
 * 
 *     def read_bytes(self, Py_ssize_t nbytes):             # <<<<<<<<<<<<<<
 *         """read a specified number of raw bytes from the stream"""
 *         cdef size_t nread
 */

#line 325 "msgpack/_unpacker.pyx"


#line 325 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_8read_bytes(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) {
  size_t __pyx_v_nread
#line 325 "msgpack/_unpacker.pyx"
;
  PyObject *__pyx_v_ret = NULL
#line 325 "msgpack/_unpacker.pyx"
;

#line 325 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 325 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_bytes", 0);

  /* "msgpack/_unpacker.pyx":328
 *         """read a specified number of raw bytes from the stream"""
 *         cdef size_t nread
 *         nread = min(self.buf_tail - self.buf_head, nbytes)             # <<<<<<<<<<<<<<
 *         ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)
 *         self.buf_head += nread
 */

#line 328 "msgpack/_unpacker.pyx"
  __pyx_t_1 = __pyx_v_nbytes;

#line 328 "msgpack/_unpacker.pyx"
  __pyx_t_2 = (__pyx_v_self->buf_tail - __pyx_v_self->buf_head);

#line 328 "msgpack/_unpacker.pyx"
  if ((__pyx_t_1 < __pyx_t_2)) {

#line 328 "msgpack/_unpacker.pyx"
    __pyx_t_3 = __pyx_t_1;

#line 328 "msgpack/_unpacker.pyx"
  } else {

#line 328 "msgpack/_unpacker.pyx"
    __pyx_t_3 = __pyx_t_2;

#line 328 "msgpack/_unpacker.pyx"
  }

#line 328 "msgpack/_unpacker.pyx"
  __pyx_v_nread = __pyx_t_3;

  /* "msgpack/_unpacker.pyx":329
 *         cdef size_t nread
 *         nread = min(self.buf_tail - self.buf_head, nbytes)
 *         ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)             # <<<<<<<<<<<<<<
 *         self.buf_head += nread
 *         if len(ret) < nbytes and self.file_like is not None:
 */

#line 329 "msgpack/_unpacker.pyx"
  __pyx_t_4 = ((PyObject *)PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_self->buf_head), __pyx_v_nread)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 329 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_4);

#line 329 "msgpack/_unpacker.pyx"
  __pyx_v_ret = __pyx_t_4;

#line 329 "msgpack/_unpacker.pyx"
  __pyx_t_4 = 0;

  /* "msgpack/_unpacker.pyx":330
 *         nread = min(self.buf_tail - self.buf_head, nbytes)
 *         ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)
 *         self.buf_head += nread             # <<<<<<<<<<<<<<
 *         if len(ret) < nbytes and self.file_like is not None:
 *             ret += self.file_like.read(nbytes - len(ret))
 */

#line 330 "msgpack/_unpacker.pyx"
  __pyx_v_self->buf_head = (__pyx_v_self->buf_head + __pyx_v_nread);

  /* "msgpack/_unpacker.pyx":331
 *         ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)
 *         self.buf_head += nread
 *         if len(ret) < nbytes and self.file_like is not None:             # <<<<<<<<<<<<<<
 *             ret += self.file_like.read(nbytes - len(ret))
 *         return ret
 */

#line 331 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 331 "msgpack/_unpacker.pyx"
  __pyx_t_5 = (__pyx_t_1 < __pyx_v_nbytes);

#line 331 "msgpack/_unpacker.pyx"
  if (__pyx_t_5) {

#line 331 "msgpack/_unpacker.pyx"
    __pyx_t_6 = (__pyx_v_self->file_like != Py_None);

#line 331 "msgpack/_unpacker.pyx"
    __pyx_t_7 = __pyx_t_6;

#line 331 "msgpack/_unpacker.pyx"
  } else {

#line 331 "msgpack/_unpacker.pyx"
    __pyx_t_7 = __pyx_t_5;

#line 331 "msgpack/_unpacker.pyx"
  }

#line 331 "msgpack/_unpacker.pyx"
  if (__pyx_t_7) {

    /* "msgpack/_unpacker.pyx":332
 *         self.buf_head += nread
 *         if len(ret) < nbytes and self.file_like is not None:
 *             ret += self.file_like.read(nbytes - len(ret))             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->file_like, __pyx_n_s__read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_4);

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_8 = PyInt_FromSsize_t((__pyx_v_nbytes - __pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_8);

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_9);

#line 332 "msgpack/_unpacker.pyx"
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_GIVEREF(__pyx_t_8);

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_8 = 0;

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_8);

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_GOTREF(__pyx_t_9);

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

#line 332 "msgpack/_unpacker.pyx"
    __Pyx_DECREF(__pyx_v_ret);

#line 332 "msgpack/_unpacker.pyx"
    __pyx_v_ret = __pyx_t_9;

#line 332 "msgpack/_unpacker.pyx"
    __pyx_t_9 = 0;

#line 332 "msgpack/_unpacker.pyx"
    goto __pyx_L3;

#line 332 "msgpack/_unpacker.pyx"
  }

#line 332 "msgpack/_unpacker.pyx"
  __pyx_L3:;

  /* "msgpack/_unpacker.pyx":333
 *         if len(ret) < nbytes and self.file_like is not None:
 *             ret += self.file_like.read(nbytes - len(ret))
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def unpack(self, object write_bytes=None):
 */

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(__pyx_v_ret);

#line 333 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_v_ret;

#line 333 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 333 "msgpack/_unpacker.pyx"


#line 333 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 333 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 333 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_4);

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_8);

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_9);

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 333 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 333 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_v_ret);

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 333 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 333 "msgpack/_unpacker.pyx"
}

#line 333 "msgpack/_unpacker.pyx"


#line 333 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 333 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 333 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_8Unpacker_10unpack[] = "Unpacker.unpack(self, write_bytes=None)\n\n        unpack one object\n\n        If write_bytes is not None, it will be called with parts of the raw\n        message as it is unpacked.\n\n        Raises `OutOfData` when there are no more bytes to unpack.\n        ";

#line 333 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_write_bytes = 0
#line 333 "msgpack/_unpacker.pyx"
;

#line 333 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 333 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("unpack (wrapper)", 0);

#line 333 "msgpack/_unpacker.pyx"
  {

#line 333 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__write_bytes,0};

#line 333 "msgpack/_unpacker.pyx"
    PyObject* values[1] = {0};

    /* "msgpack/_unpacker.pyx":335
 *         return ret
 * 
 *     def unpack(self, object write_bytes=None):             # <<<<<<<<<<<<<<
 *         """
 *         unpack one object
 */

#line 335 "msgpack/_unpacker.pyx"
    values[0] = ((PyObject *)Py_None);

#line 335 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 335 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 335 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 335 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  1: 
#line 335 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 335 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 335 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 335 "msgpack/_unpacker.pyx"
      }

#line 335 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 335 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 335 "msgpack/_unpacker.pyx"
        case  0:

#line 335 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 335 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__write_bytes);

#line 335 "msgpack/_unpacker.pyx"
          if (value) { values[0] = value; kw_args--; }

#line 335 "msgpack/_unpacker.pyx"
        }

#line 335 "msgpack/_unpacker.pyx"
      }

#line 335 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 335 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 335 "msgpack/_unpacker.pyx"
      }

#line 335 "msgpack/_unpacker.pyx"
    } else {

#line 335 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: 
#line 335 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: 
#line 335 "msgpack/_unpacker.pyx"
break;
        default: 
#line 335 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 335 "msgpack/_unpacker.pyx"
      }

#line 335 "msgpack/_unpacker.pyx"
    }

#line 335 "msgpack/_unpacker.pyx"
    __pyx_v_write_bytes = values[0];

#line 335 "msgpack/_unpacker.pyx"
  }

#line 335 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 335 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("unpack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); 
#line 335 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 335 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 335 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 335 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 335 "msgpack/_unpacker.pyx"
  return NULL;

#line 335 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 335 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_10unpack(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);

#line 335 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 335 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 335 "msgpack/_unpacker.pyx"
}

#line 335 "msgpack/_unpacker.pyx"


#line 335 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_10unpack(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {

#line 335 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 335 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("unpack", 0);

  /* "msgpack/_unpacker.pyx":344
 *         Raises `OutOfData` when there are no more bytes to unpack.
 *         """
 *         return self._unpack(template_construct, write_bytes)             # <<<<<<<<<<<<<<
 * 
 *     def skip(self, object write_bytes=None):
 */

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 344 "msgpack/_unpacker.pyx"
  __pyx_t_1 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 344 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_t_1;

#line 344 "msgpack/_unpacker.pyx"
  __pyx_t_1 = 0;

#line 344 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 344 "msgpack/_unpacker.pyx"


#line 344 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 344 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 344 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 344 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 344 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 344 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 344 "msgpack/_unpacker.pyx"
}

#line 344 "msgpack/_unpacker.pyx"


#line 344 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 344 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 344 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_8Unpacker_12skip[] = "Unpacker.skip(self, write_bytes=None)\n\n        read and ignore one object, returning None\n\n        If write_bytes is not None, it will be called with parts of the raw\n        message as it is unpacked.\n\n        Raises `OutOfData` when there are no more bytes to unpack.\n        ";

#line 344 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_write_bytes = 0
#line 344 "msgpack/_unpacker.pyx"
;

#line 344 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 344 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("skip (wrapper)", 0);

#line 344 "msgpack/_unpacker.pyx"
  {

#line 344 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__write_bytes,0};

#line 344 "msgpack/_unpacker.pyx"
    PyObject* values[1] = {0};

    /* "msgpack/_unpacker.pyx":346
 *         return self._unpack(template_construct, write_bytes)
 * 
 *     def skip(self, object write_bytes=None):             # <<<<<<<<<<<<<<
 *         """
 *         read and ignore one object, returning None
 */

#line 346 "msgpack/_unpacker.pyx"
    values[0] = ((PyObject *)Py_None);

#line 346 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 346 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 346 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 346 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  1: 
#line 346 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 346 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 346 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 346 "msgpack/_unpacker.pyx"
      }

#line 346 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 346 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 346 "msgpack/_unpacker.pyx"
        case  0:

#line 346 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 346 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__write_bytes);

#line 346 "msgpack/_unpacker.pyx"
          if (value) { values[0] = value; kw_args--; }

#line 346 "msgpack/_unpacker.pyx"
        }

#line 346 "msgpack/_unpacker.pyx"
      }

#line 346 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 346 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "skip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 346 "msgpack/_unpacker.pyx"
      }

#line 346 "msgpack/_unpacker.pyx"
    } else {

#line 346 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: 
#line 346 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: 
#line 346 "msgpack/_unpacker.pyx"
break;
        default: 
#line 346 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 346 "msgpack/_unpacker.pyx"
      }

#line 346 "msgpack/_unpacker.pyx"
    }

#line 346 "msgpack/_unpacker.pyx"
    __pyx_v_write_bytes = values[0];

#line 346 "msgpack/_unpacker.pyx"
  }

#line 346 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 346 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("skip", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); 
#line 346 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 346 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 346 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 346 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 346 "msgpack/_unpacker.pyx"
  return NULL;

#line 346 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 346 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_12skip(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);

#line 346 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 346 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 346 "msgpack/_unpacker.pyx"
}

#line 346 "msgpack/_unpacker.pyx"


#line 346 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_12skip(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {

#line 346 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 346 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("skip", 0);

  /* "msgpack/_unpacker.pyx":355
 *         Raises `OutOfData` when there are no more bytes to unpack.
 *         """
 *         return self._unpack(template_skip, write_bytes)             # <<<<<<<<<<<<<<
 * 
 *     def read_array_header(self, object write_bytes=None):
 */

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 355 "msgpack/_unpacker.pyx"
  __pyx_t_1 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_skip, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 355 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_t_1;

#line 355 "msgpack/_unpacker.pyx"
  __pyx_t_1 = 0;

#line 355 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 355 "msgpack/_unpacker.pyx"


#line 355 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 355 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 355 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 355 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 355 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 355 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 355 "msgpack/_unpacker.pyx"
}

#line 355 "msgpack/_unpacker.pyx"


#line 355 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 355 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 355 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_8Unpacker_14read_array_header[] = "Unpacker.read_array_header(self, write_bytes=None)\nassuming the next object is an array, return its size n, such that\n        the next n unpack() calls will iterate over its contents.\n\n        Raises `OutOfData` when there are no more bytes to unpack.\n        ";

#line 355 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_write_bytes = 0
#line 355 "msgpack/_unpacker.pyx"
;

#line 355 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 355 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_array_header (wrapper)", 0);

#line 355 "msgpack/_unpacker.pyx"
  {

#line 355 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__write_bytes,0};

#line 355 "msgpack/_unpacker.pyx"
    PyObject* values[1] = {0};

    /* "msgpack/_unpacker.pyx":357
 *         return self._unpack(template_skip, write_bytes)
 * 
 *     def read_array_header(self, object write_bytes=None):             # <<<<<<<<<<<<<<
 *         """assuming the next object is an array, return its size n, such that
 *         the next n unpack() calls will iterate over its contents.
 */

#line 357 "msgpack/_unpacker.pyx"
    values[0] = ((PyObject *)Py_None);

#line 357 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 357 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 357 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 357 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  1: 
#line 357 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 357 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 357 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 357 "msgpack/_unpacker.pyx"
      }

#line 357 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 357 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 357 "msgpack/_unpacker.pyx"
        case  0:

#line 357 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 357 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__write_bytes);

#line 357 "msgpack/_unpacker.pyx"
          if (value) { values[0] = value; kw_args--; }

#line 357 "msgpack/_unpacker.pyx"
        }

#line 357 "msgpack/_unpacker.pyx"
      }

#line 357 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 357 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_array_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 357 "msgpack/_unpacker.pyx"
      }

#line 357 "msgpack/_unpacker.pyx"
    } else {

#line 357 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: 
#line 357 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: 
#line 357 "msgpack/_unpacker.pyx"
break;
        default: 
#line 357 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 357 "msgpack/_unpacker.pyx"
      }

#line 357 "msgpack/_unpacker.pyx"
    }

#line 357 "msgpack/_unpacker.pyx"
    __pyx_v_write_bytes = values[0];

#line 357 "msgpack/_unpacker.pyx"
  }

#line 357 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 357 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_array_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); 
#line 357 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 357 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 357 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 357 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 357 "msgpack/_unpacker.pyx"
  return NULL;

#line 357 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 357 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_14read_array_header(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);

#line 357 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 357 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 357 "msgpack/_unpacker.pyx"
}

#line 357 "msgpack/_unpacker.pyx"


#line 357 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_14read_array_header(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {

#line 357 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 357 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_array_header", 0);

  /* "msgpack/_unpacker.pyx":363
 *         Raises `OutOfData` when there are no more bytes to unpack.
 *         """
 *         return self._unpack(read_array_header, write_bytes)             # <<<<<<<<<<<<<<
 * 
 *     def read_map_header(self, object write_bytes=None):
 */

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 363 "msgpack/_unpacker.pyx"
  __pyx_t_1 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_array_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 363 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_t_1;

#line 363 "msgpack/_unpacker.pyx"
  __pyx_t_1 = 0;

#line 363 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 363 "msgpack/_unpacker.pyx"


#line 363 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 363 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 363 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 363 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 363 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 363 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 363 "msgpack/_unpacker.pyx"
}

#line 363 "msgpack/_unpacker.pyx"


#line 363 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 363 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/

#line 363 "msgpack/_unpacker.pyx"
static char __pyx_doc_7msgpack_9_unpacker_8Unpacker_16read_map_header[] = "Unpacker.read_map_header(self, write_bytes=None)\nassuming the next object is a map, return its size n, such that the\n        next n * 2 unpack() calls will iterate over its key-value pairs.\n\n        Raises `OutOfData` when there are no more bytes to unpack.\n        ";

#line 363 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_write_bytes = 0
#line 363 "msgpack/_unpacker.pyx"
;

#line 363 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 363 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_map_header (wrapper)", 0);

#line 363 "msgpack/_unpacker.pyx"
  {

#line 363 "msgpack/_unpacker.pyx"
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__write_bytes,0};

#line 363 "msgpack/_unpacker.pyx"
    PyObject* values[1] = {0};

    /* "msgpack/_unpacker.pyx":365
 *         return self._unpack(read_array_header, write_bytes)
 * 
 *     def read_map_header(self, object write_bytes=None):             # <<<<<<<<<<<<<<
 *         """assuming the next object is a map, return its size n, such that the
 *         next n * 2 unpack() calls will iterate over its key-value pairs.
 */

#line 365 "msgpack/_unpacker.pyx"
    values[0] = ((PyObject *)Py_None);

#line 365 "msgpack/_unpacker.pyx"
    if (unlikely(__pyx_kwds)) {

#line 365 "msgpack/_unpacker.pyx"
      Py_ssize_t kw_args;

#line 365 "msgpack/_unpacker.pyx"
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);

#line 365 "msgpack/_unpacker.pyx"
      switch (pos_args) {
        case  1: 
#line 365 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);

#line 365 "msgpack/_unpacker.pyx"
        case  0: break;
        default: 
#line 365 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 365 "msgpack/_unpacker.pyx"
      }

#line 365 "msgpack/_unpacker.pyx"
      kw_args = PyDict_Size(__pyx_kwds);

#line 365 "msgpack/_unpacker.pyx"
      switch (pos_args) {

#line 365 "msgpack/_unpacker.pyx"
        case  0:

#line 365 "msgpack/_unpacker.pyx"
        if (kw_args > 0) {

#line 365 "msgpack/_unpacker.pyx"
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__write_bytes);

#line 365 "msgpack/_unpacker.pyx"
          if (value) { values[0] = value; kw_args--; }

#line 365 "msgpack/_unpacker.pyx"
        }

#line 365 "msgpack/_unpacker.pyx"
      }

#line 365 "msgpack/_unpacker.pyx"
      if (unlikely(kw_args > 0)) {

#line 365 "msgpack/_unpacker.pyx"
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_map_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 365 "msgpack/_unpacker.pyx"
      }

#line 365 "msgpack/_unpacker.pyx"
    } else {

#line 365 "msgpack/_unpacker.pyx"
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: 
#line 365 "msgpack/_unpacker.pyx"
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: 
#line 365 "msgpack/_unpacker.pyx"
break;
        default: 
#line 365 "msgpack/_unpacker.pyx"
goto __pyx_L5_argtuple_error;

#line 365 "msgpack/_unpacker.pyx"
      }

#line 365 "msgpack/_unpacker.pyx"
    }

#line 365 "msgpack/_unpacker.pyx"
    __pyx_v_write_bytes = values[0];

#line 365 "msgpack/_unpacker.pyx"
  }

#line 365 "msgpack/_unpacker.pyx"
  goto __pyx_L4_argument_unpacking_done;

#line 365 "msgpack/_unpacker.pyx"
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_map_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); 
#line 365 "msgpack/_unpacker.pyx"
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}

#line 365 "msgpack/_unpacker.pyx"
  __pyx_L3_error:;

#line 365 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 365 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 365 "msgpack/_unpacker.pyx"
  return NULL;

#line 365 "msgpack/_unpacker.pyx"
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = 
#line 365 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_16read_map_header(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);

#line 365 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 365 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 365 "msgpack/_unpacker.pyx"
}

#line 365 "msgpack/_unpacker.pyx"


#line 365 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_16read_map_header(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {

#line 365 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 365 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("read_map_header", 0);

  /* "msgpack/_unpacker.pyx":371
 *         Raises `OutOfData` when there are no more bytes to unpack.
 *         """
 *         return self._unpack(read_map_header, write_bytes)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 371 "msgpack/_unpacker.pyx"
  __pyx_t_1 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_map_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 371 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_t_1;

#line 371 "msgpack/_unpacker.pyx"
  __pyx_t_1 = 0;

#line 371 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 371 "msgpack/_unpacker.pyx"


#line 371 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 371 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 371 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 371 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 371 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 371 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 371 "msgpack/_unpacker.pyx"
}

#line 371 "msgpack/_unpacker.pyx"


#line 371 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 371 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_19__iter__(PyObject *__pyx_v_self); /*proto*/

#line 371 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_19__iter__(PyObject *__pyx_v_self) {

#line 371 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = 
#line 371 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_18__iter__(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self));

#line 371 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 371 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 371 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":373
 *         return self._unpack(read_map_header, write_bytes)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

#line 373 "msgpack/_unpacker.pyx"


#line 373 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_18__iter__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self) {

#line 373 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations

#line 373 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "msgpack/_unpacker.pyx":374
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(((PyObject *)__pyx_v_self));

#line 374 "msgpack/_unpacker.pyx"
  __pyx_r = ((PyObject *)__pyx_v_self);

#line 374 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 374 "msgpack/_unpacker.pyx"


#line 374 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 374 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 374 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 374 "msgpack/_unpacker.pyx"
}

#line 374 "msgpack/_unpacker.pyx"


#line 374 "msgpack/_unpacker.pyx"
/* Python wrapper */

#line 374 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_21__next__(PyObject *__pyx_v_self); /*proto*/

#line 374 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pw_7msgpack_9_unpacker_8Unpacker_21__next__(PyObject *__pyx_v_self) {

#line 374 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = 0;

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyDeclarations

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = 
#line 374 "msgpack/_unpacker.pyx"
__pyx_pf_7msgpack_9_unpacker_8Unpacker_20__next__(((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)__pyx_v_self));

#line 374 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 374 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 374 "msgpack/_unpacker.pyx"
}

/* "msgpack/_unpacker.pyx":376
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return self._unpack(template_construct, None, 1)
 * 
 */

#line 376 "msgpack/_unpacker.pyx"


#line 376 "msgpack/_unpacker.pyx"
static PyObject *__pyx_pf_7msgpack_9_unpacker_8Unpacker_20__next__(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *__pyx_v_self) {

#line 376 "msgpack/_unpacker.pyx"
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7msgpack_9_unpacker_8Unpacker__unpack __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

#line 376 "msgpack/_unpacker.pyx"
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "msgpack/_unpacker.pyx":377
 * 
 *     def __next__(self):
 *         return self._unpack(template_construct, None, 1)             # <<<<<<<<<<<<<<
 * 
 *     # for debug.
 */

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_r);

#line 377 "msgpack/_unpacker.pyx"
  __pyx_t_2.__pyx_n = 1;

#line 377 "msgpack/_unpacker.pyx"
  __pyx_t_2.iter = 1;

#line 377 "msgpack/_unpacker.pyx"
  __pyx_t_1 = ((struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, Py_None, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 377 "msgpack/_unpacker.pyx"
  __pyx_r = __pyx_t_1;

#line 377 "msgpack/_unpacker.pyx"
  __pyx_t_1 = 0;

#line 377 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 377 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_AddTraceback("msgpack._unpacker.Unpacker.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 377 "msgpack/_unpacker.pyx"
  __pyx_r = NULL;

#line 377 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_XGIVEREF(__pyx_r);

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 377 "msgpack/_unpacker.pyx"
  return __pyx_r;

#line 377 "msgpack/_unpacker.pyx"
}

#line 377 "msgpack/_unpacker.pyx"
static struct __pyx_vtabstruct_7msgpack_9_unpacker_Unpacker __pyx_vtable_7msgpack_9_unpacker_Unpacker;

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyObject *__pyx_tp_new_7msgpack_9_unpacker_Unpacker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {

#line 377 "msgpack/_unpacker.pyx"
  struct __pyx_obj_7msgpack_9_unpacker_Unpacker *p;

#line 377 "msgpack/_unpacker.pyx"
  PyObject *o = (*t->tp_alloc)(t, 0);

#line 377 "msgpack/_unpacker.pyx"
  if (!o) return 0;

#line 377 "msgpack/_unpacker.pyx"
  p = ((struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)o);

#line 377 "msgpack/_unpacker.pyx"
  p->__pyx_vtab = __pyx_vtabptr_7msgpack_9_unpacker_Unpacker;

#line 377 "msgpack/_unpacker.pyx"
  p->file_like = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  p->file_like_read = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  p->object_hook = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  p->encoding = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  p->unicode_errors = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  if (__pyx_pw_7msgpack_9_unpacker_8Unpacker_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {

#line 377 "msgpack/_unpacker.pyx"
    Py_DECREF(o); o = 0;

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  return o;

#line 377 "msgpack/_unpacker.pyx"
}

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static void __pyx_tp_dealloc_7msgpack_9_unpacker_Unpacker(PyObject *o) {

#line 377 "msgpack/_unpacker.pyx"
  struct __pyx_obj_7msgpack_9_unpacker_Unpacker *p = (struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)o;

#line 377 "msgpack/_unpacker.pyx"
  PyObject_GC_UnTrack(o);

#line 377 "msgpack/_unpacker.pyx"
  {

#line 377 "msgpack/_unpacker.pyx"
    PyObject *etype, *eval, *etb;

#line 377 "msgpack/_unpacker.pyx"
    PyErr_Fetch(&etype, &eval, &etb);

#line 377 "msgpack/_unpacker.pyx"
    ++Py_REFCNT(o);

#line 377 "msgpack/_unpacker.pyx"
    __pyx_pw_7msgpack_9_unpacker_8Unpacker_3__dealloc__(o);

#line 377 "msgpack/_unpacker.pyx"
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);

#line 377 "msgpack/_unpacker.pyx"
    --Py_REFCNT(o);

#line 377 "msgpack/_unpacker.pyx"
    PyErr_Restore(etype, eval, etb);

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  Py_CLEAR(p->file_like);

#line 377 "msgpack/_unpacker.pyx"
  Py_CLEAR(p->file_like_read);

#line 377 "msgpack/_unpacker.pyx"
  Py_CLEAR(p->object_hook);

#line 377 "msgpack/_unpacker.pyx"
  Py_CLEAR(p->encoding);

#line 377 "msgpack/_unpacker.pyx"
  Py_CLEAR(p->unicode_errors);

#line 377 "msgpack/_unpacker.pyx"
  PyObject_GC_Track(o);

#line 377 "msgpack/_unpacker.pyx"
  (*Py_TYPE(o)->tp_free)(o);

#line 377 "msgpack/_unpacker.pyx"
}

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static int __pyx_tp_traverse_7msgpack_9_unpacker_Unpacker(PyObject *o, visitproc v, void *a) {

#line 377 "msgpack/_unpacker.pyx"
  int e;

#line 377 "msgpack/_unpacker.pyx"
  struct __pyx_obj_7msgpack_9_unpacker_Unpacker *p = (struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)o;

#line 377 "msgpack/_unpacker.pyx"
  if (p->file_like) {

#line 377 "msgpack/_unpacker.pyx"
    e = (*v)(p->file_like, a); if (e) return e;

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  if (p->file_like_read) {

#line 377 "msgpack/_unpacker.pyx"
    e = (*v)(p->file_like_read, a); if (e) return e;

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  if (p->object_hook) {

#line 377 "msgpack/_unpacker.pyx"
    e = (*v)(p->object_hook, a); if (e) return e;

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  if (p->encoding) {

#line 377 "msgpack/_unpacker.pyx"
    e = (*v)(p->encoding, a); if (e) return e;

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  if (p->unicode_errors) {

#line 377 "msgpack/_unpacker.pyx"
    e = (*v)(p->unicode_errors, a); if (e) return e;

#line 377 "msgpack/_unpacker.pyx"
  }

#line 377 "msgpack/_unpacker.pyx"
  return 0;

#line 377 "msgpack/_unpacker.pyx"
}

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static int __pyx_tp_clear_7msgpack_9_unpacker_Unpacker(PyObject *o) {

#line 377 "msgpack/_unpacker.pyx"
  struct __pyx_obj_7msgpack_9_unpacker_Unpacker *p = (struct __pyx_obj_7msgpack_9_unpacker_Unpacker *)o;

#line 377 "msgpack/_unpacker.pyx"
  PyObject* tmp;

#line 377 "msgpack/_unpacker.pyx"
  tmp = ((PyObject*)p->file_like);

#line 377 "msgpack/_unpacker.pyx"
  p->file_like = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  Py_XDECREF(tmp);

#line 377 "msgpack/_unpacker.pyx"
  tmp = ((PyObject*)p->file_like_read);

#line 377 "msgpack/_unpacker.pyx"
  p->file_like_read = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  Py_XDECREF(tmp);

#line 377 "msgpack/_unpacker.pyx"
  tmp = ((PyObject*)p->object_hook);

#line 377 "msgpack/_unpacker.pyx"
  p->object_hook = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  Py_XDECREF(tmp);

#line 377 "msgpack/_unpacker.pyx"
  tmp = ((PyObject*)p->encoding);

#line 377 "msgpack/_unpacker.pyx"
  p->encoding = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  Py_XDECREF(tmp);

#line 377 "msgpack/_unpacker.pyx"
  tmp = ((PyObject*)p->unicode_errors);

#line 377 "msgpack/_unpacker.pyx"
  p->unicode_errors = Py_None; Py_INCREF(Py_None);

#line 377 "msgpack/_unpacker.pyx"
  Py_XDECREF(tmp);

#line 377 "msgpack/_unpacker.pyx"
  return 0;

#line 377 "msgpack/_unpacker.pyx"
}

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyMethodDef __pyx_methods_7msgpack_9_unpacker_Unpacker[] = {

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_7feed, METH_O, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_8Unpacker_6feed)},

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("read_bytes"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_9read_bytes, METH_O, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_8Unpacker_8read_bytes)},

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_11unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_8Unpacker_10unpack)},

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("skip"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_13skip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_8Unpacker_12skip)},

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("read_array_header"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_15read_array_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_8Unpacker_14read_array_header)},

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("read_map_header"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_17read_map_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7msgpack_9_unpacker_8Unpacker_16read_map_header)},

#line 377 "msgpack/_unpacker.pyx"
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7msgpack_9_unpacker_8Unpacker_21__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},

#line 377 "msgpack/_unpacker.pyx"
  {0, 0, 0, 0}

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyNumberMethods __pyx_tp_as_number_Unpacker = {

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_add*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_subtract*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_multiply*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_divide*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_remainder*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_divmod*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_power*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_negative*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_positive*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_absolute*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_nonzero*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_invert*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_lshift*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_rshift*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_and*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_xor*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_or*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_coerce*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_int*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_long*/

#line 377 "msgpack/_unpacker.pyx"
  #else

#line 377 "msgpack/_unpacker.pyx"
  0, /*reserved*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_float*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_oct*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_hex*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_add*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_subtract*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_multiply*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_divide*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_remainder*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_power*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_lshift*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_rshift*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_and*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_xor*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_or*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_floor_divide*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_true_divide*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_floor_divide*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_inplace_true_divide*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_VERSION_HEX >= 0x02050000

#line 377 "msgpack/_unpacker.pyx"
  0, /*nb_index*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PySequenceMethods __pyx_tp_as_sequence_Unpacker = {

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_length*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_concat*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_repeat*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_item*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_slice*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_ass_item*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_ass_slice*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_contains*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_inplace_concat*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*sq_inplace_repeat*/

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyMappingMethods __pyx_tp_as_mapping_Unpacker = {

#line 377 "msgpack/_unpacker.pyx"
  0, /*mp_length*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*mp_subscript*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*mp_ass_subscript*/

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyBufferProcs __pyx_tp_as_buffer_Unpacker = {

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*bf_getreadbuffer*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*bf_getwritebuffer*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*bf_getsegcount*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*bf_getcharbuffer*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  #if PY_VERSION_HEX >= 0x02060000

#line 377 "msgpack/_unpacker.pyx"
  0, /*bf_getbuffer*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  #if PY_VERSION_HEX >= 0x02060000

#line 377 "msgpack/_unpacker.pyx"
  0, /*bf_releasebuffer*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyTypeObject __pyx_type_7msgpack_9_unpacker_Unpacker = {

#line 377 "msgpack/_unpacker.pyx"
  PyVarObject_HEAD_INIT(0, 0)

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_NAMESTR("msgpack._unpacker.Unpacker"), /*tp_name*/

#line 377 "msgpack/_unpacker.pyx"
  sizeof(struct __pyx_obj_7msgpack_9_unpacker_Unpacker), /*tp_basicsize*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_itemsize*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_tp_dealloc_7msgpack_9_unpacker_Unpacker, /*tp_dealloc*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_print*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_getattr*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_setattr*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_compare*/

#line 377 "msgpack/_unpacker.pyx"
  #else

#line 377 "msgpack/_unpacker.pyx"
  0, /*reserved*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_repr*/

#line 377 "msgpack/_unpacker.pyx"
  &__pyx_tp_as_number_Unpacker, /*tp_as_number*/

#line 377 "msgpack/_unpacker.pyx"
  &__pyx_tp_as_sequence_Unpacker, /*tp_as_sequence*/

#line 377 "msgpack/_unpacker.pyx"
  &__pyx_tp_as_mapping_Unpacker, /*tp_as_mapping*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_hash*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_call*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_str*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_getattro*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_setattro*/

#line 377 "msgpack/_unpacker.pyx"
  &__pyx_tp_as_buffer_Unpacker, /*tp_as_buffer*/

#line 377 "msgpack/_unpacker.pyx"
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/

#line 377 "msgpack/_unpacker.pyx"
  __Pyx_DOCSTR("Unpacker(file_like=None, Py_ssize_t read_size=0, int use_list=1, object_hook=None, object_pairs_hook=None, list_hook=None, encoding=None, unicode_errors='strict', int max_buffer_size=0)\n\n    Streaming unpacker.\n\n    `file_like` is a file-like object having `.read(n)` method.\n    When `Unpacker` initialized with `file_like`, unpacker reads serialized data\n    from it and `.feed()` method is not usable.\n\n    `read_size` is used as `file_like.read(read_size)`.\n    (default: min(1024**2, max_buffer_size))\n\n    If `use_list` is true (default), msgpack list is deserialized to Python list.\n    Otherwise, it is deserialized to Python tuple.\n\n    `object_hook` is same to simplejson. If it is not None, it should be callable\n    and Unpacker calls it with a dict argument after deserializing a map.\n\n    `object_pairs_hook` is same to simplejson. If it is not None, it should be callable\n    and Unpacker calls it with a list of key-value pairs after deserializing a map.\n\n    `encoding` is encoding used for decoding msgpack bytes. If it is None (default),\n    msgpack bytes is deserialized to Python bytes.\n\n    `unicode_errors` is used for decoding bytes.\n\n    `max_buffer_size` limits size of data waiting unpacked.\n    0 means system's INT_MAX (default).\n    Raises `BufferFull` exception when it is insufficient.\n    You shoud set this parameter when unpacking data from untrasted source.\n\n    example of streaming deserialize from file-like object::\n\n        unpacker = Unpacker(file_like)\n        for o in unpacker:\n            do_something(o)\n\n    example of streaming deserialize from socket::\n\n        unpacker = Unpacker()\n        while 1:\n            buf = sock.recv(1024**2)\n            if not buf:\n                break\n            unpacker.feed(buf)\n            for o in unpacker:\n                do_something(o)\n    "), /*tp_doc*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_tp_traverse_7msgpack_9_unpacker_Unpacker, /*tp_traverse*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_tp_clear_7msgpack_9_unpacker_Unpacker, /*tp_clear*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_richcompare*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_weaklistoffset*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_pw_7msgpack_9_unpacker_8Unpacker_19__iter__, /*tp_iter*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_pw_7msgpack_9_unpacker_8Unpacker_21__next__, /*tp_iternext*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_methods_7msgpack_9_unpacker_Unpacker, /*tp_methods*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_members*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_getset*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_base*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_dict*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_descr_get*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_descr_set*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_dictoffset*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_pw_7msgpack_9_unpacker_8Unpacker_5__init__, /*tp_init*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_alloc*/

#line 377 "msgpack/_unpacker.pyx"
  __pyx_tp_new_7msgpack_9_unpacker_Unpacker, /*tp_new*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_free*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_is_gc*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_bases*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_mro*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_cache*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_subclasses*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_weaklist*/

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_del*/

#line 377 "msgpack/_unpacker.pyx"
  #if PY_VERSION_HEX >= 0x02060000

#line 377 "msgpack/_unpacker.pyx"
  0, /*tp_version_tag*/

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
static PyMethodDef __pyx_methods[] = {

#line 377 "msgpack/_unpacker.pyx"
  {0, 0, 0, 0}

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"


#line 377 "msgpack/_unpacker.pyx"
#if PY_MAJOR_VERSION >= 3

#line 377 "msgpack/_unpacker.pyx"
static struct PyModuleDef __pyx_moduledef = {

#line 377 "msgpack/_unpacker.pyx"
  #if PY_VERSION_HEX < 0x03020000

#line 377 "msgpack/_unpacker.pyx"
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },

#line 377 "msgpack/_unpacker.pyx"
  #else

#line 377 "msgpack/_unpacker.pyx"
    PyModuleDef_HEAD_INIT,

#line 377 "msgpack/_unpacker.pyx"
  #endif

#line 377 "msgpack/_unpacker.pyx"
    __Pyx_NAMESTR("_unpacker"),

#line 377 "msgpack/_unpacker.pyx"
    0, /* m_doc */

#line 377 "msgpack/_unpacker.pyx"
    -1, /* m_size */

#line 377 "msgpack/_unpacker.pyx"
    __pyx_methods /* m_methods */,

#line 377 "msgpack/_unpacker.pyx"
    NULL, /* m_reload */

#line 377 "msgpack/_unpacker.pyx"
    NULL, /* m_traverse */

#line 377 "msgpack/_unpacker.pyx"
    NULL, /* m_clear */

#line 377 "msgpack/_unpacker.pyx"
    NULL /* m_free */

#line 377 "msgpack/_unpacker.pyx"
};

#line 377 "msgpack/_unpacker.pyx"
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_n_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 1},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s__BufferFull, __pyx_k__BufferFull, sizeof(__pyx_k__BufferFull), 0, 0, 1, 1},
  {&__pyx_n_s__ExtraData, __pyx_k__ExtraData, sizeof(__pyx_k__ExtraData), 0, 0, 1, 1},
  {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s__OutOfData, __pyx_k__OutOfData, sizeof(__pyx_k__OutOfData), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__UnpackValueError, __pyx_k__UnpackValueError, sizeof(__pyx_k__UnpackValueError), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__ascii, __pyx_k__ascii, sizeof(__pyx_k__ascii), 0, 0, 1, 1},
  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
  {&__pyx_n_s__buf_len, __pyx_k__buf_len, sizeof(__pyx_k__buf_len), 0, 0, 1, 1},
  {&__pyx_n_s__cenc, __pyx_k__cenc, sizeof(__pyx_k__cenc), 0, 0, 1, 1},
  {&__pyx_n_s__cerr, __pyx_k__cerr, sizeof(__pyx_k__cerr), 0, 0, 1, 1},
  {&__pyx_n_s__ctx, __pyx_k__ctx, sizeof(__pyx_k__ctx), 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_n_s__file_like, __pyx_k__file_like, sizeof(__pyx_k__file_like), 0, 0, 1, 1},
  {&__pyx_n_s__list_hook, __pyx_k__list_hook, sizeof(__pyx_k__list_hook), 0, 0, 1, 1},
  {&__pyx_n_s__max_buffer_size, __pyx_k__max_buffer_size, sizeof(__pyx_k__max_buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
  {&__pyx_n_s__object_hook, __pyx_k__object_hook, sizeof(__pyx_k__object_hook), 0, 0, 1, 1},
  {&__pyx_n_s__object_pairs_hook, __pyx_k__object_pairs_hook, sizeof(__pyx_k__object_pairs_hook), 0, 0, 1, 1},
  {&__pyx_n_s__off, __pyx_k__off, sizeof(__pyx_k__off), 0, 0, 1, 1},
  {&__pyx_n_s__packed, __pyx_k__packed, sizeof(__pyx_k__packed), 0, 0, 1, 1},
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
  {&__pyx_n_s__read_size, __pyx_k__read_size, sizeof(__pyx_k__read_size), 0, 0, 1, 1},
  {&__pyx_n_s__ret, __pyx_k__ret, sizeof(__pyx_k__ret), 0, 0, 1, 1},
  {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1},
  {&__pyx_n_s__strict, __pyx_k__strict, sizeof(__pyx_k__strict), 0, 0, 1, 1},
  {&__pyx_n_s__unicode_errors, __pyx_k__unicode_errors, sizeof(__pyx_k__unicode_errors), 0, 0, 1, 1},
  {&__pyx_n_s__unpack, __pyx_k__unpack, sizeof(__pyx_k__unpack), 0, 0, 1, 1},
  {&__pyx_n_s__unpackb, __pyx_k__unpackb, sizeof(__pyx_k__unpackb), 0, 0, 1, 1},
  {&__pyx_n_s__use_list, __pyx_k__use_list, sizeof(__pyx_k__use_list), 0, 0, 1, 1},
  {&__pyx_n_s__write_bytes, __pyx_k__write_bytes, sizeof(__pyx_k__write_bytes), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_s__AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "msgpack/_unpacker.pyx":57
 * 
 *     if object_hook is not None and object_pairs_hook is not None:
 *         raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")             # <<<<<<<<<<<<<<
 * 
 *     if object_hook is not None:
 */

#line 57 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 57 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_2);

#line 57 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

  /* "msgpack/_unpacker.pyx":61
 *     if object_hook is not None:
 *         if not PyCallable_Check(object_hook):
 *             raise TypeError("object_hook must be a callable.")             # <<<<<<<<<<<<<<
 *         ctx.user.object_hook = <PyObject*>object_hook
 * 
 */

#line 61 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 61 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_4);

#line 61 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

  /* "msgpack/_unpacker.pyx":68
 *     else:
 *         if not PyCallable_Check(object_pairs_hook):
 *             raise TypeError("object_pairs_hook must be a callable.")             # <<<<<<<<<<<<<<
 *         ctx.user.object_hook = <PyObject*>object_pairs_hook
 *         ctx.user.has_pairs_hook = True
 */

#line 68 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 68 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_6);

#line 68 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

  /* "msgpack/_unpacker.pyx":74
 *     if list_hook is not None:
 *         if not PyCallable_Check(list_hook):
 *             raise TypeError("list_hook must be a callable.")             # <<<<<<<<<<<<<<
 *         ctx.user.list_hook = <PyObject*>list_hook
 * 
 */

#line 74 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_7)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 74 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_8);

#line 74 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "msgpack/_unpacker.pyx":101
 *     if encoding is not None:
 *         if isinstance(encoding, unicode):
 *             encoding = encoding.encode('ascii')             # <<<<<<<<<<<<<<
 *         cenc = PyBytes_AsString(encoding)
 * 
 */

#line 101 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ascii)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 101 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_9);

#line 101 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "msgpack/_unpacker.pyx":106
 *     if unicode_errors is not None:
 *         if isinstance(unicode_errors, unicode):
 *             unicode_errors = unicode_errors.encode('ascii')             # <<<<<<<<<<<<<<
 *         cerr = PyBytes_AsString(unicode_errors)
 * 
 */

#line 106 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ascii)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 106 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_10);

#line 106 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

  /* "msgpack/_unpacker.pyx":210
 *             self.file_like_read = file_like.read
 *             if not PyCallable_Check(self.file_like_read):
 *                 raise ValueError("`file_like.read` must be a callable.")             # <<<<<<<<<<<<<<
 *         if not max_buffer_size:
 *             max_buffer_size = INT_MAX
 */

#line 210 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 210 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_13);

#line 210 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));

  /* "msgpack/_unpacker.pyx":214
 *             max_buffer_size = INT_MAX
 *         if read_size > max_buffer_size:
 *             raise ValueError("read_size should be less or equal to max_buffer_size")             # <<<<<<<<<<<<<<
 *         if not read_size:
 *             read_size = min(max_buffer_size, 1024**2)
 */

#line 214 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_15 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_14)); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 214 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_15);

#line 214 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "msgpack/_unpacker.pyx":221
 *         self.buf = <char*>malloc(read_size)
 *         if self.buf == NULL:
 *             raise MemoryError("Unable to allocate internal buffer.")             # <<<<<<<<<<<<<<
 *         self.buf_size = read_size
 *         self.buf_head = 0
 */

#line 221 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_17 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 221 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_17);

#line 221 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

  /* "msgpack/_unpacker.pyx":228
 *         if encoding is not None:
 *             if isinstance(encoding, unicode):
 *                 encoding = encoding.encode('ascii')             # <<<<<<<<<<<<<<
 *             self.encoding = encoding
 *             cenc = PyBytes_AsString(encoding)
 */

#line 228 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_18 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ascii)); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 228 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_18);

#line 228 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));

  /* "msgpack/_unpacker.pyx":234
 *         if unicode_errors is not None:
 *             if isinstance(unicode_errors, unicode):
 *                 unicode_errors = unicode_errors.encode('ascii')             # <<<<<<<<<<<<<<
 *             self.unicode_errors = unicode_errors
 *             cerr = PyBytes_AsString(unicode_errors)
 */

#line 234 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ascii)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 234 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_19);

#line 234 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "msgpack/_unpacker.pyx":245
 *         cdef Py_ssize_t buf_len
 *         if self.file_like is not None:
 *             raise AssertionError(             # <<<<<<<<<<<<<<
 *                     "unpacker.feed() is not be able to use with `file_like`.")
 *         PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)
 */

#line 245 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 245 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_21);

#line 245 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));

  /* "msgpack/_unpacker.pyx":275
 *                     # self.buf still holds old buffer and will be freed during
 *                     # obj destruction
 *                     raise MemoryError("Unable to enlarge internal buffer.")             # <<<<<<<<<<<<<<
 *                 memcpy(new_buf, buf + head, tail - head)
 *                 free(buf)
 */

#line 275 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 275 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_23);

#line 275 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "msgpack/_unpacker.pyx":319
 *                     continue
 *                 if iter:
 *                     raise StopIteration("No more data to unpack.")             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise OutOfData("No more data to unpack.")
 */

#line 319 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_25 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_24)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 319 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_25);

#line 319 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));

  /* "msgpack/_unpacker.pyx":321
 *                     raise StopIteration("No more data to unpack.")
 *                 else:
 *                     raise OutOfData("No more data to unpack.")             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("Unpack failed: error = %d" % (ret,))
 */

#line 321 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_24)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 321 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_26);

#line 321 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "msgpack/_unpacker.pyx":80
 *     ctx.user.unicode_errors = unicode_errors
 * 
 * def unpackb(object packed, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *             bint use_list=1, encoding=None, unicode_errors="strict",
 *             object_pairs_hook=None,
 */

#line 80 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_28 = PyTuple_Pack(15, ((PyObject *)__pyx_n_s__packed), ((PyObject *)__pyx_n_s__object_hook), ((PyObject *)__pyx_n_s__list_hook), ((PyObject *)__pyx_n_s__use_list), ((PyObject *)__pyx_n_s__encoding), ((PyObject *)__pyx_n_s__unicode_errors), ((PyObject *)__pyx_n_s__object_pairs_hook), ((PyObject *)__pyx_n_s__ctx), ((PyObject *)__pyx_n_s__off), ((PyObject *)__pyx_n_s__ret), ((PyObject *)__pyx_n_s__buf), ((PyObject *)__pyx_n_s__buf_len), ((PyObject *)__pyx_n_s__cenc), ((PyObject *)__pyx_n_s__cerr), ((PyObject *)__pyx_n_s__obj)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_28);

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

#line 80 "msgpack/_unpacker.pyx"
  __pyx_k_codeobj_29 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_30, __pyx_n_s__unpackb, 80, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "msgpack/_unpacker.pyx":122
 * 
 * 
 * def unpack(object stream, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *            bint use_list=1, encoding=None, unicode_errors="strict",
 *            object_pairs_hook=None,
 */

#line 122 "msgpack/_unpacker.pyx"
  __pyx_k_tuple_32 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__stream), ((PyObject *)__pyx_n_s__object_hook), ((PyObject *)__pyx_n_s__list_hook), ((PyObject *)__pyx_n_s__use_list), ((PyObject *)__pyx_n_s__encoding), ((PyObject *)__pyx_n_s__unicode_errors), ((PyObject *)__pyx_n_s__object_pairs_hook)); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_k_tuple_32);

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

#line 122 "msgpack/_unpacker.pyx"
  __pyx_k_codeobj_33 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_30, __pyx_n_s__unpack, 122, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 122 "msgpack/_unpacker.pyx"
  return 0;

#line 122 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 122 "msgpack/_unpacker.pyx"
  return -1;

#line 122 "msgpack/_unpacker.pyx"
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_unpacker(void); /*proto*/
PyMODINIT_FUNC init_unpacker(void)
#else
PyMODINIT_FUNC PyInit__unpacker(void); /*proto*/
PyMODINIT_FUNC PyInit__unpacker(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__unpacker(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_unpacker"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "msgpack._unpacker")) {
      if (unlikely(PyDict_SetItemString(modules, "msgpack._unpacker", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_msgpack___unpacker) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_7msgpack_9_unpacker_Unpacker = &__pyx_vtable_7msgpack_9_unpacker_Unpacker;
  __pyx_vtable_7msgpack_9_unpacker_Unpacker.append_buffer = (PyObject *(*)(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *, void *, Py_ssize_t))__pyx_f_7msgpack_9_unpacker_8Unpacker_append_buffer;
  __pyx_vtable_7msgpack_9_unpacker_Unpacker.read_from_file = (PyObject *(*)(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *))__pyx_f_7msgpack_9_unpacker_8Unpacker_read_from_file;
  __pyx_vtable_7msgpack_9_unpacker_Unpacker._unpack = (PyObject *(*)(struct __pyx_obj_7msgpack_9_unpacker_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_7msgpack_9_unpacker_8Unpacker__unpack *__pyx_optional_args))__pyx_f_7msgpack_9_unpacker_8Unpacker__unpack;
  if (PyType_Ready(&__pyx_type_7msgpack_9_unpacker_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7msgpack_9_unpacker_Unpacker.tp_dict, __pyx_vtabptr_7msgpack_9_unpacker_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Unpacker", (PyObject *)&__pyx_type_7msgpack_9_unpacker_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7msgpack_9_unpacker_Unpacker = &__pyx_type_7msgpack_9_unpacker_Unpacker;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "msgpack/_unpacker.pyx":16
 * 
 * from msgpack.exceptions import (
 *         BufferFull,             # <<<<<<<<<<<<<<
 *         OutOfData,
 *         UnpackValueError,
 */

#line 16 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BufferFull));

#line 16 "msgpack/_unpacker.pyx"
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__BufferFull));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BufferFull));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(((PyObject *)__pyx_n_s__OutOfData));

#line 16 "msgpack/_unpacker.pyx"
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__OutOfData));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__OutOfData));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(((PyObject *)__pyx_n_s__UnpackValueError));

#line 16 "msgpack/_unpacker.pyx"
  PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__UnpackValueError));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__UnpackValueError));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ExtraData));

#line 16 "msgpack/_unpacker.pyx"
  PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__ExtraData));

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ExtraData));

#line 16 "msgpack/_unpacker.pyx"
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_27), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

#line 16 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__BufferFull);

#line 16 "msgpack/_unpacker.pyx"
  if (__pyx_t_1 == NULL) {

#line 16 "msgpack/_unpacker.pyx"
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__BufferFull);

#line 16 "msgpack/_unpacker.pyx"
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  }

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 16 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BufferFull, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

#line 16 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__OutOfData);

#line 16 "msgpack/_unpacker.pyx"
  if (__pyx_t_1 == NULL) {

#line 16 "msgpack/_unpacker.pyx"
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__OutOfData);

#line 16 "msgpack/_unpacker.pyx"
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  }

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 16 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__OutOfData, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

#line 16 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__UnpackValueError);

#line 16 "msgpack/_unpacker.pyx"
  if (__pyx_t_1 == NULL) {

#line 16 "msgpack/_unpacker.pyx"
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__UnpackValueError);

#line 16 "msgpack/_unpacker.pyx"
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  }

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 16 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UnpackValueError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

#line 16 "msgpack/_unpacker.pyx"
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ExtraData);

#line 16 "msgpack/_unpacker.pyx"
  if (__pyx_t_1 == NULL) {

#line 16 "msgpack/_unpacker.pyx"
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__ExtraData);

#line 16 "msgpack/_unpacker.pyx"
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  }

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_1);

#line 16 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ExtraData, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

#line 16 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "msgpack/_unpacker.pyx":80
 *     ctx.user.unicode_errors = unicode_errors
 * 
 * def unpackb(object packed, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *             bint use_list=1, encoding=None, unicode_errors="strict",
 *             object_pairs_hook=None,
 */

#line 80 "msgpack/_unpacker.pyx"
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7msgpack_9_unpacker_1unpackb, NULL, __pyx_n_s_31); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 80 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpackb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 80 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "msgpack/_unpacker.pyx":122
 * 
 * 
 * def unpack(object stream, object object_hook=None, object list_hook=None,             # <<<<<<<<<<<<<<
 *            bint use_list=1, encoding=None, unicode_errors="strict",
 *            object_pairs_hook=None,
 */

#line 122 "msgpack/_unpacker.pyx"
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7msgpack_9_unpacker_3unpack, NULL, __pyx_n_s_31); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(__pyx_t_2);

#line 122 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 122 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "msgpack/_unpacker.pyx":1
 * # coding: utf-8             # <<<<<<<<<<<<<<
 * #cython: embedsignature=True
 * 
 */

#line 1 "msgpack/_unpacker.pyx"
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 1 "msgpack/_unpacker.pyx"
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

#line 1 "msgpack/_unpacker.pyx"
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#line 1 "msgpack/_unpacker.pyx"
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

#line 1 "msgpack/_unpacker.pyx"
  goto __pyx_L0;

#line 1 "msgpack/_unpacker.pyx"
  __pyx_L1_error:;

#line 1 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_1);

#line 1 "msgpack/_unpacker.pyx"
  __Pyx_XDECREF(__pyx_t_2);

#line 1 "msgpack/_unpacker.pyx"
  if (__pyx_m) {

#line 1 "msgpack/_unpacker.pyx"
    __Pyx_AddTraceback("init msgpack._unpacker", __pyx_clineno, __pyx_lineno, __pyx_filename);

#line 1 "msgpack/_unpacker.pyx"
    Py_DECREF(__pyx_m); __pyx_m = 0;

#line 1 "msgpack/_unpacker.pyx"
  } else if (!PyErr_Occurred()) {

#line 1 "msgpack/_unpacker.pyx"
    PyErr_SetString(PyExc_ImportError, "init msgpack._unpacker");

#line 1 "msgpack/_unpacker.pyx"
  }

#line 1 "msgpack/_unpacker.pyx"
  __pyx_L0:;

#line 1 "msgpack/_unpacker.pyx"
  __Pyx_RefNannyFinishContext();

#line 1 "msgpack/_unpacker.pyx"
  #if PY_MAJOR_VERSION < 3

#line 1 "msgpack/_unpacker.pyx"
  return;

#line 1 "msgpack/_unpacker.pyx"
  #else

#line 1 "msgpack/_unpacker.pyx"
  return __pyx_m;

#line 1 "msgpack/_unpacker.pyx"
  #endif

#line 1 "msgpack/_unpacker.pyx"
}

#line 1 "cython_utility"

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#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;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            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;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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 *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 = PyEval_CallObject(type, args);
        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 && cause != Py_None) {
        PyObject *fixed_cause;
        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) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CPYTHON_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_CheckExact(key)) && 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,
        "%s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import = 0;
    py_import = __Pyx_GetAttrString(__pyx_b, "__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_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

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);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s 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 (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

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) / 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, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,      /*int firstlineno,*/
        __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;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

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  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
